Skip to content

Don't try to parse javascript as JSON#239

Merged
jnunemaker merged 1 commit intojnunemaker:masterfrom
jasonroelofs:fix_javascript_parsing
Sep 27, 2013
Merged

Don't try to parse javascript as JSON#239
jnunemaker merged 1 commit intojnunemaker:masterfrom
jasonroelofs:fix_javascript_parsing

Conversation

@jasonroelofs
Copy link
Contributor

Trying to download files with the mime-type application/javascript (pure
javascript files) ends up running through the JSON parser. As javascript
code is not JSON, so this ends up throwing a MultiJSON::LoadError.

Trying to download files with the mime-type application/javascript (pure
javascript files) ends up running through the JSON parser. Javascript
code is not JSON, so this ends up throwing a MultiJSON::LoadError.
@jnunemaker
Copy link
Owner

Downside is that it affects backwards compatibility quite a bit, but I see what you mean. Hummmmmmm...

jnunemaker pushed a commit that referenced this pull request Sep 27, 2013
@jnunemaker jnunemaker merged commit 9d0c4f5 into jnunemaker:master Sep 27, 2013
@jnunemaker
Copy link
Owner

Ok, I agree. Going with it. If I get chewed out by some upset user, so be it. :D This does feel more right to me.

@jasonroelofs
Copy link
Contributor Author

Awesome, thanks. I have a hard time seeing how anyone could be using this legitimately, unless they were then overwriting #json to handle things differently to get around this, but then again I'm sure we've both seen stranger.

@jasonroelofs jasonroelofs deleted the fix_javascript_parsing branch October 2, 2013 18:57
@xxx
Copy link

xxx commented Nov 14, 2013

Apple's Itunes API uses text/javascript as the mime type of its json responses. I have little hope that anyone will get them to fix it however.

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.

3 participants