mirror of
https://github.com/status-im/react-native-fs.git
synced 2025-03-01 07:20:33 +00:00
set response statuscode even if content length is zero
This commit is contained in:
parent
6c6fd49060
commit
9f4192f014
@ -72,6 +72,10 @@
|
|||||||
|
|
||||||
- (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask didFinishDownloadingToURL:(NSURL *)location
|
- (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask didFinishDownloadingToURL:(NSURL *)location
|
||||||
{
|
{
|
||||||
|
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)downloadTask.response;
|
||||||
|
if (!_statusCode) {
|
||||||
|
_statusCode = [NSNumber numberWithLong:httpResponse.statusCode];
|
||||||
|
}
|
||||||
NSURL *destURL = [NSURL fileURLWithPath:_params.toFile];
|
NSURL *destURL = [NSURL fileURLWithPath:_params.toFile];
|
||||||
NSFileManager *fm = [NSFileManager defaultManager];
|
NSFileManager *fm = [NSFileManager defaultManager];
|
||||||
NSError *error = nil;
|
NSError *error = nil;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user