Fix incorrect _isLocalFileConnection if a locally called web application calls a remote server.

If a locally called web application (called with file://foo/index.html) is doing a http get request call using "http://whatever/", we receive a connection:didReceiveResponse: of response type CPURLResponse instead CPHTTPURLResponse as expected.
This commit is contained in:
Stefan Eilers committed 2012-04-26 12:13:46 +02:00
1 parent b04dbb647b
commit 9b017de39c
1 file changed
+2 -6
+2 -6
View File
@@ -151,12 +151,8 @@ var CPURLConnectionDelegate = nil;
var URL = [_request URL],
scheme = [URL scheme];
// Browsers use "file:", Titanium uses "app:"
_isLocalFileConnection = scheme === "file" ||
((scheme === "http" || scheme === "https:") &&
window.location &&
(window.location.protocol === "file:" || window.location.protocol === "app:"));
// Browsers use "file:"
_isLocalFileConnection = scheme === "file";
_HTTPRequest = new CFHTTPRequest();
if (shouldStartImmediately)