]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] WebUI: drop unreachable 304 success branch 6124/head
authorAlexander Moisseev <moiseev@mezonplus.ru>
Fri, 10 Jul 2026 16:31:49 +0000 (19:31 +0300)
committerAlexander Moisseev <moiseev@mezonplus.ru>
Fri, 10 Jul 2026 16:31:49 +0000 (19:31 +0300)
The Rspamd controller sends "Cache-Control: no-store" on every WebUI
response (controller.c, issue #3330) and never emits Last-Modified/ETag
for these endpoints, so a browser never revalidates and a 304 response
is impossible. The `|| xhr.status === 304` in queryServer was dead code
copied from jQuery's default success range.

Remove it so queryServer, the /stat connect probe and the legacy /auth
probe all treat 200-299 as success. Treating 304 as an error is also
safer: a 304 body is empty, and success would have fed it to the JSON
parser.

interface/js/app/common.js

index 06207ba7a7ed3ef54bc1e706b547ac3dcee026b1..d4f3ae1784328032c84bf2341ff2fbc65b0216b6 100644 (file)
@@ -532,7 +532,7 @@ define(["nprogress"],
             }
 
             xhr.onload = function () {
-                const ok = (xhr.status >= 200 && xhr.status < 300) || xhr.status === 304;
+                const ok = xhr.status >= 200 && xhr.status < 300;
                 if (!ok) {
                     handleError("error", xhr.statusText);
                     return;