mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-10 02:40:59 +00:00
Fixed: Reworked withCredentials for XMLHTTPRequests
Previously, the withCredentials parameter was accessed primarily through the CPURLConnection, which gave limited access to changing the request before it was sent off. This commit removes withCredentials from CPURLConnection and places it on CPURLRequest so that it may be more easily modified prior to sending the request. This also simplifies the logic in CPURLConnection for creating and establishing connections with credentials. In this commit, all CFHTTPRequests are assumed to not use withCredentials unless they are explicitly set. Setting [aURLRequest withCredentials] will set the withCredentials property on the underlying XMLHTTPRequest prior to the connection being opened.
This commit is contained in:
1 parent
8024f6a804
commit
d1917db47e
3 files changed
+9
-33
No files matched your search
@@ -103,6 +103,9 @@ GLOBAL(CFHTTPRequest) = function()
|
||||
this._eventDispatcher = new EventDispatcher(this);
|
||||
this._nativeRequest = new NativeRequest();
|
||||
|
||||
// by default, all requests will assume that credentials should not be sent.
|
||||
this._nativeRequest.withCredentials = false;
|
||||
|
||||
var self = this;
|
||||
this._stateChangeHandler = function()
|
||||
{
|
||||
@@ -279,7 +282,7 @@ CFHTTPRequest.prototype.setWithCredentials = function(/*Boolean*/ willSendWithCr
|
||||
this._nativeRequest.withCredentials = willSendWithCredentials;
|
||||
};
|
||||
|
||||
CFHTTPRequest.prototype.getWithCredentials = function()
|
||||
CFHTTPRequest.prototype.withCredentials = function()
|
||||
{
|
||||
return this._nativeRequest.withCredentials;
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user