Werk #18991 · Mar 31, 26
Fix status codes on ajax calls
Previously, when an AJAX request triggered an error (e.g. due to an unauthenticated request), the server
always responded with 200 OK containing a JSON error body like:
{"result_code": 1, "result": "Not authenticated: You are not authenticated.", "severity": "error"}
This caused AJAX error handlers that check HTTP status codes to not trigger, resulting in the raw JSON being rendered in the UI instead of proper error handling.
The server now returns the correct HTTP status code (e.g. 401 for unauthenticated requests) alongside
the JSON error body.
Details
- Class:
- Bug Fixes
- Level:
- Trivial
- Component:
- Multisite
- Versions:
- 3.0.0b1Not yet releasedAll Editions
- 2.5.0b3All Editions
- 2.4.0p36All Editions