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

Handling anti-XSS prefixes #86

Open
JulianBirch opened this issue Sep 13, 2015 · 3 comments
Open

Handling anti-XSS prefixes #86

JulianBirch opened this issue Sep 13, 2015 · 3 comments

Comments

@JulianBirch
Copy link

In cljs-ajax, I've got a feature that allows you to specify that you're expecting a JSON response to be prefixed with (for instance) while(1);, like some Google APIs do. Would you be interested in a PR that added such a feature into the opts in Cheshire?

@dakrone
Copy link
Owner

dakrone commented Sep 14, 2015

@JulianBirch I'm afraid I don't quite understand what this does, can you give me an example input that you are talking about? What does this have to do with CSS?

@JulianBirch JulianBirch changed the title Handling anti-CSS prefixes Handling anti-XSS prefixes Sep 14, 2015
@JulianBirch
Copy link
Author

Really should have written XSS, sorry (edited the heading). An example is something like while(1);{"a" "b"}. Typically this is coming back as a response to a GET. So you need to strip the prefix off to get a useful result. (Namely `{"a" "b"})

Here's a reference on it: http://stackoverflow.com/questions/2669690/why-does-google-prepend-while1-to-their-json-responses

@dakrone
Copy link
Owner

dakrone commented Sep 15, 2015

@JulianBirch ahh okay, that makes much more sense than CSS :)

I think it would be worth adding, perhaps as a special decode-with-leader method or something similar?

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

No branches or pull requests

2 participants