diff --git a/Objective-J/CFHTTPRequest.js b/Objective-J/CFHTTPRequest.js index d4f9cba76..f44b334db 100644 --- a/Objective-J/CFHTTPRequest.js +++ b/Objective-J/CFHTTPRequest.js @@ -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