Closed
Bug 647362
Opened 14 years ago
Closed 14 years ago
Use HTTP status codes for AJAX errors
Categories
(Websites Graveyard :: markup.mozilla.org, defect)
Websites Graveyard
markup.mozilla.org
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: wenzel, Assigned: adam)
Details
(Whiteboard: [qa-])
markup.requests.* send JSON errors with a 200 response code and success=False or error=something in the content.
This bears the risk of an error reply being cached.
Instead, please return HTTP error codes properly. A 200 code should not be used unless the request was successful.
Django has all response codes built-in that you should need:
http://docs.djangoproject.com/en/dev/ref/request-response/#httpresponse-subclasses
Further, jQuery has an error function for AJAX requests that catches such codes appropriately.
Updated•14 years ago
|
Assignee: nobody → adam
Assignee | ||
Comment 1•14 years ago
|
||
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Comment 2•14 years ago
|
||
Fred, is this easily testable via the front-end, with the Web Console open, or is it something you wouldn't mind verifying via code inspection? Thanks!
Comment 3•14 years ago
|
||
This isn't easily verifiable, but the code looks good.
Updated•14 years ago
|
Whiteboard: [qa-]
Updated•3 years ago
|
Product: Websites → Websites Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•