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

Removed X-Requested-With to stop cross domain issues #37

Closed
wants to merge 1 commit into from
Closed

Removed X-Requested-With to stop cross domain issues #37

wants to merge 1 commit into from

Conversation

jamescorbett
Copy link

When working with Cross domain enabled services often X-Requested-With isn't added to the allowed headers and Chrome will throw an error.

I've removed the offending line but I don't know why it was added in the first place.

@jamescorbett jamescorbett changed the title Removed X-Requested-With to stop cross domain issues. Issue #36 Removed X-Requested-With to stop cross domain issues Apr 13, 2014
@jimhigson
Copy link
Owner

Hi, yes, good point.

There's a fairly good convention where AJAX libraries add this header. I'm not sure how important it is though - in all honesty, in all my days doing web applications I've never actually relied on it for anything.

My usual approach is to look what jQuery does for issues like this. They only set the header for same-domain requests - see here - following the principle of least surprise that sounds pretty sensible.

I'll have a bit of time on a train pretty soon. I'll take a look at copying jQ and retag a new minor version.

@jimhigson
Copy link
Owner

Fixed as of v.1.14.5 so that this header is only added if the request is not cross-origin.

@jimhigson jimhigson closed this May 15, 2014
@jamescorbett
Copy link
Author

Thank you, I can switch back to the vanilla library now :)

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.

None yet

2 participants