Add global 403 handler for CFHTTPRequest, to make it easier to catch authentication challenges.

This commit is contained in:
Ross Boucher
2010-05-01 11:57:32 -07:00
parent 1545f7b60a
commit f98d3bd44b
+6
View File
@@ -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