Skip to content
This repository was archived by the owner on Apr 20, 2018. It is now read-only.

Commit 5e54624

Browse files
committed
added option withCredentials for CORS request, src/ajax/ajax.js
1 parent e9c9f54 commit 5e54624

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/ajax/ajax.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
function getCORSRequest() {
2727
var xhr = new root.XMLHttpRequest();
2828
if ('withCredentials' in xhr) {
29-
xhr.withCredentials = true;
29+
xhr.withCredentials = this.withCredentials ? true : false;
3030
return xhr;
3131
} else if (!!root.XDomainRequest) {
3232
return new XDomainRequest();
@@ -205,8 +205,9 @@
205205
headers: {},
206206
responseType: 'text',
207207
timeout: 0,
208+
withCredentials: false,
208209
createXHR: function(){
209-
return this.crossDomain ? getCORSRequest() : getXMLHttpRequest()
210+
return this.crossDomain ? getCORSRequest.call(this) : getXMLHttpRequest()
210211
},
211212
normalizeError: normalizeAjaxErrorEvent,
212213
normalizeSuccess: normalizeAjaxSuccessEvent

0 commit comments

Comments
 (0)