#10527 closed bug (fixed)
AJAX deferred should call success on "No Content," even when a Content-Type is specified
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | low | Milestone: | None |
Component: | ajax | Version: | 1.6 |
Keywords: | needsreview | Cc: | jaubourg |
Blocked by: | Blocking: |
Description
When a Content-Type such as "text/xml" is specified in an HTTP 204 ("No Content") status, jquery finds a converter for the datastream in the ajaxConvert() function. This ends up calling parseXML, which creates an invalid XML document and jquery throws an error.
In a 204 No Content situation, jquery should not attempt to parse the empty document. Or, parseXML should return an empty document when passed an empty string.
Change History (9)
comment:1 Changed 11 years ago by
Cc: | jaubourg added |
---|---|
Component: | unfiled → ajax |
Priority: | undecided → low |
comment:2 Changed 11 years ago by
Owner: | set to [email protected]… |
---|---|
Status: | new → pending |
comment:3 Changed 11 years ago by
Resolution: | → invalid |
---|---|
Status: | pending → closed |
Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!
comment:4 Changed 11 years ago by
Resolution: | invalid |
---|---|
Status: | closed → reopened |
comment:5 Changed 11 years ago by
Keywords: | needsreview added |
---|---|
Status: | reopened → open |
comment:6 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | open → closed |
Makes parseXML act like parseJSON when given an empty or non-string input: now returns null rather than throwing an exception. Incidently fixes #10527. Unit tests added.
Changeset: d30859eb6bd5af9aafa9db003e17835ff594d019
comment:7 Changed 11 years ago by
It looks like this has been fixed in 1.7.2. For anyone trying to work around this in a previous version, I found that forcing the datatype to 'text' in an ajax query works.
comment:8 follow-up: 9 Changed 10 years ago by
This is still broken in 1.7.2 when using 'jsonp' dataType.
comment:9 Changed 10 years ago by
Replying to anonymous:
This is still broken in 1.7.2 when using 'jsonp' dataType.
jsFiddle use-case please.
Thanks for taking the time to contribute to the jQuery project! Please provide a reduced test case to help us assess your ticket.
Additionally, be sure to test against the git version to ensure the issue still exists.