Skip to content

Conversation

@bostrom
Copy link

@bostrom bostrom commented May 9, 2018

This PR improves the way the response data type is inferred.

Problem: JSON data is not parsed unless the dataType property is set explicitly to json or jsonp.

jQuery specs for the dataType property:

The type of data that you're expecting back from the server. If none is specified, jQuery will try to infer it based on the MIME type of the response (an XML MIME type will yield XML, in 1.4 JSON will yield a JavaScript object, in 1.4 script will execute the script, and anything else will be returned as a string).

This PR adds parsing of the response data when the Content-Type response header is application/json, which would more closely mimic the original behaviour of jQuery.

Side note: Tests seem to be broken in master, I added mine, but there were several old tests that don't pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant