File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -25,11 +25,7 @@ export interface AjaxRequest {
25
25
26
26
function getCORSRequest ( this : AjaxRequest ) : XMLHttpRequest {
27
27
if ( root . XMLHttpRequest ) {
28
- const xhr = new root . XMLHttpRequest ( ) ;
29
- if ( 'withCredentials' in xhr ) {
30
- xhr . withCredentials = ! ! this . withCredentials ;
31
- }
32
- return xhr ;
28
+ return new root . XMLHttpRequest ( ) ;
33
29
} else if ( ! ! root . XDomainRequest ) {
34
30
return new root . XDomainRequest ( ) ;
35
31
} else {
@@ -248,10 +244,14 @@ export class AjaxSubscriber<T> extends Subscriber<Event> {
248
244
return null ;
249
245
}
250
246
251
- // timeout and responseType can be set once the XHR is open
247
+ // timeout, responseType and withCredentials can be set once the XHR is open
252
248
xhr . timeout = request . timeout ;
253
249
xhr . responseType = request . responseType ;
254
250
251
+ if ( 'withCredentials' in xhr ) {
252
+ xhr . withCredentials = ! ! request . withCredentials ;
253
+ }
254
+
255
255
// set headers
256
256
this . setHeaders ( xhr , headers ) ;
257
257
You can’t perform that action at this time.
0 commit comments