You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
XDR requests on Chrome suddenly started making additional "preflight" OPTIONS requests in YUI 3.9.1. This line is the culprit:
// Convert falsy values to an empty string. This way IE can't be
// rediculous and translate `undefined` to "undefined".
data || (data = );
when the call is made to 'transaction.c.send(data);', Chrome adds the Content-Length: 0 header which, since it's not one of the "Simple" headers defined by the W3C (http://www.w3.org/TR/cors/#simple-header) triggers a preflight OPTIONS request to ensure CORS is authorized.
One possible fix is to make the above change conditional, as in:
if (!SUPPORTS_CORS) {
// Convert falsy values to an empty string. This way IE can't be
// ridiculous and translate `undefined` to "undefined".
data || (data = );
}
The above is confirmed to work with Chrome and Firefox, have not tested IE.
The text was updated successfully, but these errors were encountered:
Per my trak comment, I would recommend forking on data and calling send() without an argument rather than dance about with "acceptable" values between implementations.
Mind you, this should also be validated against the IE content-length issue.
Posted for @chrisrhut, migrated from http://yuilibrary.com/projects/yui3/ticket/2533248
XDR requests on Chrome suddenly started making additional "preflight" OPTIONS requests in YUI 3.9.1. This line is the culprit:
when the call is made to 'transaction.c.send(data);', Chrome adds the Content-Length: 0 header which, since it's not one of the "Simple" headers defined by the W3C (http://www.w3.org/TR/cors/#simple-header) triggers a preflight OPTIONS request to ensure CORS is authorized.
One possible fix is to make the above change conditional, as in:
The above is confirmed to work with Chrome and Firefox, have not tested IE.
The text was updated successfully, but these errors were encountered: