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