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)

defect
Not set
normal

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.
Assignee: nobody → adam
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
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!
This isn't easily verifiable, but the code looks good.
Product: Websites → Websites Graveyard
You need to log in before you can comment on or make changes to this bug.