Fix for CPDocument not opening with file local URLs.

Reviewed by me.
This commit is contained in:
Francisco Ryan Tolmasky I
2009-01-17 13:50:37 -08:00
parent e926aad568
commit e05e8788d6
3 changed files with 35 additions and 11 deletions
+5 -1
View File
@@ -386,10 +386,14 @@ var CPDocumentUntitledCount = 0;
*/
- (void)connection:(CPURLConnection)aConnection didReceiveResponse:(CPURLResponse)aResponse
{
// If we got this far and it wasn't an HTTP request, then everything is fine.
if (![aResponse isKindOfClass:[CPHTTPURLResponse class]])
return;
var statusCode = [aResponse statusCode];
// Nothing to do if everything is hunky dory.
if (statusCode === 200 || (statusCode === 0 && [aConnection isLocalFileConnection]))
if (statusCode === 200)
return;
var session = aConnection.session;