Fix Chrome warning when using synchronous XHR requests

This commit is contained in:
Roland Schwingel committed 2015-08-20 14:52:19 +02:00
1 parent 65b3e9f8c1
commit 2ab9186259
1 file changed
+3 -2
+3 -2
View File
@@ -246,7 +246,8 @@ CFHTTPRequest.prototype.open = function(/*String*/ aMethod, /*String*/ aURL, /*B
this._user = aUser;
this._password = aPassword;
retval = this._nativeRequest.open(aMethod, aURL, isAsynchronous, aUser, aPassword);
this._nativeRequest.withCredentials = this._withCredentials;
if (this._async)
this._nativeRequest.withCredentials = this._withCredentials;
return retval;
};
@@ -304,7 +305,7 @@ CFHTTPRequest.prototype.removeEventListener = function(/*String*/ anEventName, /
CFHTTPRequest.prototype.setWithCredentials = function(/*Boolean*/ willSendWithCredentials)
{
this._withCredentials = willSendWithCredentials
if (this._isOpen)
if (this._isOpen && this._async)
this._nativeRequest.withCredentials = willSendWithCredentials;
};