mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-16 13:31:18 +00:00
CPURLConnection calls didFailWithError instead of didReceiveResponse for successful HTTP responses other than 200
This commit is contained in:
1 parent
453845dd20
commit
a4b75b0132
1 file changed
+3
-5
@@ -251,15 +251,13 @@ var CPURLConnectionDelegate = nil;
|
||||
|
||||
if (!_isCanceled)
|
||||
{
|
||||
if (statusCode == 200 || (statusCode === 0 && _isLocalFileConnection))
|
||||
if (statusCode == 401 && [CPURLConnectionDelegate respondsToSelector:@selector(connectionDidReceiveAuthenticationChallenge:)])
|
||||
[CPURLConnectionDelegate connectionDidReceiveAuthenticationChallenge:self];
|
||||
else
|
||||
{
|
||||
[_delegate connection:self didReceiveData:_XMLHTTPRequest.responseText];
|
||||
[_delegate connectionDidFinishLoading:self];
|
||||
}
|
||||
else if (statusCode == 401 && [CPURLConnectionDelegate respondsToSelector:@selector(connectionDidReceiveAuthenticationChallenge:)])
|
||||
[CPURLConnectionDelegate connectionDidReceiveAuthenticationChallenge:self];
|
||||
else
|
||||
[_delegate connection:self didFailWithError:_XMLHTTPRequest.status]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user