Change server ping to POST method Closes #4006

213a619b33d61b4de9015bf01a094a2c8bbb573a

Cohee <18619528+Cohee1207@users.noreply.github.com>

3 files changed, +3 -3Ignore whitespace
public/script.js+1 -1
@@ -945,7 +945,7 @@ $.ajaxPrefilter((options, originalOptions, xhr) => {
945945export async function pingServer() {
946946 try {
947947 const result = await fetch('api/ping', {
948948 method: 'GETPOST',
949949 headers: getRequestHeaders(),
950950 });
951951
public/scripts/user.js+1 -1
@@ -903,7 +903,7 @@ async function slugify(text) {
903903async function extendUserSession() {
904904 try {
905905 const response = await fetch('/api/ping?extend=1', {
906906 method: 'GETPOST',
907907 headers: getRequestHeaders(),
908908 });
909909
src/server-main.js+1 -1
@@ -231,7 +231,7 @@ app.use('/api/users', usersPublicRouter);
231231
232232// Everything below this line requires authentication
233233app.use(requireLoginMiddleware);
234234app.getuse('/api/ping', (request, response) => {
235235 if (request.query.extend && request.session) {
236236 request.session.touch = Date.now();
237237 }