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

Automatic lower-case for request headers breaks default .NET applications #99

Closed
slaneyrw opened this issue Jan 19, 2015 · 2 comments
Closed

Comments

@slaneyrw
Copy link

Microsoft's MVC framework uses a request header of "X-Requested-With" = "XMLHttpRequest" to determine whether a request is an "AJAX" request. jQuery also follow this paradigm.

The text plugin converts all headers to lower case, breaking the default detection mechanism.

Is there any reason why all headers are converted to lower case ?

@jrburke
Copy link
Member

jrburke commented Jan 19, 2015

HTTP headers are supposed to be case-insensitive according to the RFCs for that part of the protocol, so it should not matter what the case is. If the casing is important for a particular server, you could use the onXhr hook to set the header manually:

https://github.com/requirejs/text#custom-xhr-hooks

@jrburke jrburke closed this as completed Jan 19, 2015
@slaneyrw
Copy link
Author

Then why be opinionated about casing. If people want lower case headers then supply a javascript object with lower case fields.

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