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

fix(http) Force content type to be 'text/plain' #34

Merged
merged 1 commit into from Sep 23, 2015
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

fix(http) Force content type to be 'text/plain'

This will let CORS requests be marked as a simple request and
therefore not require a preflight request.

While Chrome was using text/plain as the content-type, Safari defaults
to application/xml and therefore forcing a non-simple CORS request.
  • Loading branch information
Ivan Tam Ivan Tam
Ivan Tam authored and Ivan Tam committed Sep 22, 2015
commit 4115228ad133377034542f96b4517303f457c858
@@ -154,6 +154,7 @@
//creating an asynchronous XMLHttpRequest
var xmlHttp = new XMLHttpRequest();
xmlHttp.open('POST', this.inputUrl, true); //true for asynchronous request
xmlHttp.setRequestHeader('Content-Type', 'text/plain');
xmlHttp.send(JSON.stringify(data));

} catch (ex) {

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.