CPURLConnection calls didFailWithError instead of didReceiveResponse for successful HTTP responses other than 200

This commit is contained in:
Thomas Balthazar authored and Ross Boucher committed 2009-05-12 16:12:07 -07:00
1 parent 453845dd20
commit a4b75b0132
1 file changed
+3 -5
+3 -5
View File
@@ -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]
}
}