mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-14 14:41:28 +00:00
Add global 403 handler for CFHTTPRequest, to make it easier to catch authentication challenges.
This commit is contained in:
@@ -101,6 +101,9 @@ GLOBAL(CFHTTPRequest) = function()
|
||||
{
|
||||
determineAndDispatchHTTPRequestEvents(self);
|
||||
}
|
||||
|
||||
if (CFHTTPRequest.AuthenticationDelegate !== nil)
|
||||
this._eventDispatcher.addEventListener("HTTP403", function(){CFHTTPRequest.AuthenticationDelegate(self)});
|
||||
}
|
||||
|
||||
CFHTTPRequest.UninitializedState = 0;
|
||||
@@ -109,6 +112,9 @@ CFHTTPRequest.LoadedState = 2;
|
||||
CFHTTPRequest.InteractiveState = 3;
|
||||
CFHTTPRequest.CompleteState = 4;
|
||||
|
||||
//override to forward all CFHTTPRequest authorization failures to a single function
|
||||
CFHTTPRequest.AuthenticationDelegate = nil;
|
||||
|
||||
CFHTTPRequest.prototype.status = function()
|
||||
{
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user