File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -92,11 +92,12 @@ if ( jQuery.support.ajax ) {
92
92
xhr . overrideMimeType ( s . mimeType ) ;
93
93
}
94
94
95
- // Requested-With header
96
- // Not set for crossDomain requests with no content
97
- // (see why at http://trac.dojotoolkit.org/ticket/9486)
98
- // Won't change header if already provided
99
- if ( ! ( s . crossDomain && ! s . hasContent ) && ! headers [ "X-Requested-With" ] ) {
95
+ // X-Requested-With header
96
+ // For cross-domain requests, seeing as conditions for a preflight are
97
+ // akin to a jigsaw puzzle, we simply never set it to be sure.
98
+ // (it can always be set on a per-request basis or even using ajaxSetup)
99
+ // For same-domain requests, won't change header if already provided.
100
+ if ( ! s . crossDomain && ! headers [ "X-Requested-With" ] ) {
100
101
headers [ "X-Requested-With" ] = "XMLHttpRequest" ;
101
102
}
102
103
You can’t perform that action at this time.
0 commit comments