View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0023184 | mantisbt | bugtracker | public | 2017-08-04 16:49 | 2017-09-03 18:41 |
Reporter | dregad | Assigned To | dregad | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Target Version | 2.6.0 | Fixed in Version | 2.6.0 | ||
Summary | 0023184: AJAX calls with invalid endpoints fail with syntax error | ||||
Description | xmlhttprequest.php returns string This causes the AJAX call to fail with a syntax error, as it expects JSON data but receives text instead. The code should return a proper HTTP error code instead. | ||||
Steps To Reproduce | AJAX script:
Console log: error message: | ||||
Tags | No tags attached. | ||||
MantisBT: master c57a735d 2017-08-09 22:43 Details Diff |
XHR: send HTTP 400 error for invalid entry point Returning an HTTP error code from xmlhttprequest back to the caller instead of just outputting some arbitrary text message ensures that the client's call actually fails, without relying on the failure being caused by mismatch in output type, or detecting the error by parsing the output. HTTP 400 (Bad Request) error code was chosen following discussion in pull request https://github.com/mantisbt/mantisbt/pull/1139. Fixes 0023184 |
Affected Issues 0023184 |
|
mod - xmlhttprequest.php | Diff File |