Change server ping to POST method

Closes #4006
This commit is contained in:
Cohee
2025-05-17 16:50:02 +03:00
parent b093f71ae0
commit 213a619b33
3 changed files with 3 additions and 3 deletions

View File

@ -945,7 +945,7 @@ $.ajaxPrefilter((options, originalOptions, xhr) => {
export async function pingServer() {
try {
const result = await fetch('api/ping', {
method: 'GET',
method: 'POST',
headers: getRequestHeaders(),
});

View File

@ -903,7 +903,7 @@ async function slugify(text) {
async function extendUserSession() {
try {
const response = await fetch('/api/ping?extend=1', {
method: 'GET',
method: 'POST',
headers: getRequestHeaders(),
});

View File

@ -231,7 +231,7 @@ app.use('/api/users', usersPublicRouter);
// Everything below this line requires authentication
app.use(requireLoginMiddleware);
app.get('/api/ping', (request, response) => {
app.use('/api/ping', (request, response) => {
if (request.query.extend && request.session) {
request.session.touch = Date.now();
}