mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-26 08:25:52 +00:00
Fix for local CPURLConnection requests (file:///)
This commit is contained in:
1 parent
937865ef83
commit
add1776125
1 file changed
+3
-2
@@ -222,14 +222,15 @@ var CPURLConnectionDelegate = nil;
|
||||
{
|
||||
if (_XMLHTTPRequest.readyState == XMLHTTPRequestComplete)
|
||||
{
|
||||
var statusCode = _XMLHTTPRequest.status;
|
||||
var statusCode = _XMLHTTPRequest.status,
|
||||
url = [_request URL];
|
||||
|
||||
if ([_delegate respondsToSelector:@selector(connection:didReceiveResponse:)])
|
||||
[_delegate connection:self didReceiveResponse:[[CPHTTPURLResponse alloc] _initWithStatusCode:statusCode]];
|
||||
|
||||
if (!_isCanceled)
|
||||
{
|
||||
if (statusCode == 200)
|
||||
if (statusCode == 200 || (url.indexOf("file:") === 0 && statusCode === 0) || ((url.indexOf("http:") !== 0 || url.indexOf("https:") !== 0) && window.location && window.location.protocol === "file:" && statusCode === 0))
|
||||
{
|
||||
[_delegate connection:self didReceiveData:_XMLHTTPRequest.responseText];
|
||||
[_delegate connectionDidFinishLoading:self];
|
||||
|
||||
Reference in new issue
Block a user