Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't try to parse javascript as JSON #239

Merged
merged 1 commit into from
Sep 27, 2013
Merged

Don't try to parse javascript as JSON #239

merged 1 commit into from
Sep 27, 2013

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