Toggle navigation
Toggle navigation
This project
Loading...
Sign in
iOS
/
asi-http-request
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Ben Copsey
2009-08-29 09:51:26 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
925acc67a8a1c7bb43d85ab1909637f95dd7109e
925acc67
1 parent
25ad47f0
Fail gracefully when attempting to download to an invalid local path
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletions
Classes/ASIHTTPRequest.m
Classes/Tests/ASIHTTPRequestTests.m
Classes/ASIHTTPRequest.m
View file @
925acc6
...
...
@@ -2218,7 +2218,9 @@ static NSRecursiveLock *delegateAuthenticationLock = nil;
+
(
int
)
uncompressZippedDataFromFile
:
(
NSString
*
)
sourcePath
toFile
:
(
NSString
*
)
destinationPath
{
// Create an empty file at the destination path
[[
NSFileManager
defaultManager
]
createFileAtPath
:
destinationPath
contents
:[
NSData
data
]
attributes
:
nil
];
if
(
!
[[
NSFileManager
defaultManager
]
createFileAtPath
:
destinationPath
contents
:[
NSData
data
]
attributes
:
nil
])
{
return
1
;
}
// Get a FILE struct for the source file
NSFileHandle
*
inputFileHandle
=
[
NSFileHandle
fileHandleForReadingAtPath
:
sourcePath
];
...
...
Classes/Tests/ASIHTTPRequestTests.m
View file @
925acc6
...
...
@@ -879,6 +879,21 @@
GHAssertNotNil
([
request
error
],
@"Failed to generate an authentication error"
);
}
-
(
void
)
testFetchToInvalidPath
{
// Test gzipped content
ASIHTTPRequest
*
request
=
[
ASIHTTPRequest
requestWithURL
:[
NSURL
URLWithString
:
@"http://allseeing-i.com"
]];
[
request
setDownloadDestinationPath
:
@"/an/invalid/location.html"
];
[
request
start
];
GHAssertNotNil
([
request
error
],
@"Failed to generate an authentication when attempting to write to an invalid location"
);
//Test non-gzipped content
request
=
[
ASIHTTPRequest
requestWithURL
:[
NSURL
URLWithString
:
@"http://allseeing-i.com/i/logo.png"
]];
[
request
setDownloadDestinationPath
:
@"/an/invalid/location.png"
];
[
request
start
];
GHAssertNotNil
([
request
error
],
@"Failed to generate an authentication when attempting to write to an invalid location"
);
}
@end
...
...
Please
register
or
login
to post a comment