Skip to content

Commit 7e838fa

Browse files
committed
Partial download resuming more conservative regarding server response.
A server has to explicitly return the Accept-Ranges header with a set value other than none.
1 parent c983115 commit 7e838fa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cocos2d/CCPackageDownload.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,8 @@ - (BOOL)didServerRejectRangeRequest:(NSHTTPURLResponse *)httpResponse
434434
{
435435
return _fileSize > 0
436436
&& (_fileSize != [httpResponse expectedContentLength])
437-
&& [httpResponse.allHeaderFields[@"Accept-Ranges"] isEqualToString:@"none"];
437+
&& ([httpResponse.allHeaderFields[@"Accept-Ranges"] isEqualToString:@"none"]
438+
|| !httpResponse.allHeaderFields[@"Accept-Ranges"]);
438439
}
439440

440441
- (void)restartDownload

0 commit comments

Comments
 (0)