Werk #18991: Fix status codes on ajax calls
| Component | User interface | ||||
| Title | Fix status codes on ajax calls | ||||
| Date | Mar 31, 2026 | ||||
| Level | Trivial Change | ||||
| Class | Bug Fix | ||||
| Compatibility | Compatible - no manual interaction needed | ||||
| Checkmk versions & editions |
|
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.