Change server ping to POST method Closes #4006
| @@ -945,7 +945,7 @@ $.ajaxPrefilter((options, originalOptions, xhr) => { | ||
| 945 | 945 | export async function pingServer() { |
| 946 | 946 | try { |
| 947 | 947 | const result = await fetch('api/ping', { |
| 948 | 948 | method: 'GETPOST', |
| 949 | 949 | headers: getRequestHeaders(), |
| 950 | 950 | }); |
| 951 | 951 | |
| @@ -903,7 +903,7 @@ async function slugify(text) { | ||
| 903 | 903 | async function extendUserSession() { |
| 904 | 904 | try { |
| 905 | 905 | const response = await fetch('/api/ping?extend=1', { |
| 906 | 906 | method: 'GETPOST', |
| 907 | 907 | headers: getRequestHeaders(), |
| 908 | 908 | }); |
| 909 | 909 | |
| @@ -231,7 +231,7 @@ app.use('/api/users', usersPublicRouter); | ||
| 231 | 231 | |
| 232 | 232 | // Everything below this line requires authentication |
| 233 | 233 | app.use(requireLoginMiddleware); |
| 234 | 234 | app.getuse('/api/ping', (request, response) => { |
| 235 | 235 | if (request.query.extend && request.session) { |
| 236 | 236 | request.session.touch = Date.now(); |
| 237 | 237 | } |