Skip to content

Instantly share code, notes, and snippets.

@kara-ryli
Created June 21, 2012 18:29
Show Gist options
  • Select an option

  • Save kara-ryli/2967608 to your computer and use it in GitHub Desktop.

Select an option

Save kara-ryli/2967608 to your computer and use it in GitHub Desktop.
Avoid an OPTIONS request when using DataSource.IO with CORS headers
YUI().use("datasource-io", function (Y) {
// Described in YUI 3.3.0's patch notes
// http://yuilibrary.com/projects/yui3/wiki/ReadMe/RollUp_3.3.0?version=3
//
var ds = new Y.DataSource.IO({
source: "http://www.example.com/",
ioConfig: {
headers: {
"X-Requested-With": "disable"
}
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment