Skip to main content

Bug Tracker

Side navigation

#13525 closed bug (notabug)

Opened February 27, 2013 10:05AM UTC

Closed March 13, 2013 12:42AM UTC

ajax: incorrect/inconsistent handling of 204 NO CONTENT and 205 RESET CONTENT

Reported by: yaniv@aknin.name Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.9.1
Keywords: Cc:
Blocked by: Blocking:
Description

As you can see here (https://github.com/jquery/jquery/blob/master/src/ajax.js#L628), $.ajax has special handling for HTTP 204 responses thus that no attempt is made to convert their body (because as per the RFC, 204 responses MUST NOT have a body).

No such special casing is done for 205 RESET CONTENT responses, which also MUST NOT have a body, thus that 205 responses received with a Content-Type that should be converted fail unexpectedly (their fail() handler is called instead of done()).

IMHO, the trivial and obvious fix is to add a similar special case for 205 responses. Since I'm not a regular contributor, I doubt a pull request is worth the extra for to produce one.

Also, see here (http://jsfiddle.net/Sj3a6/2/) for a small jsfiddle+heroku app combo that demonstrates the problem.

Attachments (0)
Change History (2)

Changed March 02, 2013 07:26PM UTC by yaniv@aknin.name comment:1

I believe this (http://trac.tools.ietf.org/wg/httpbis/trac/ticket/88) ticket, along with the proposed amendment to rfc2616, clarifies the intended difference between 204 and 205. This isn't a bug in jQuery, and this ticket should be closed.

Changed March 13, 2013 12:42AM UTC by timmywil comment:2

resolution: → notabug
status: newclosed

Thank yaniv