Fix HTTP Header key field nullable

This commit is contained in:
zhongwuzw 2018-07-03 21:18:02 +08:00
parent 5fc84dbbba
commit 6674b9f711
2 changed files with 4 additions and 1 deletions

View File

@ -61,7 +61,7 @@
You can specify a runloop mode to let it rendering.
Default is NSRunLoopCommonModes on multi-core iOS device, NSDefaultRunLoopMode on single-core iOS device
*/
@property (nonatomic, copy, nonnull) NSRunLoopMode runLoopMode NS_AVAILABLE_IOS(3_1);
@property (nonatomic, copy, nonnull) NSRunLoopMode runLoopMode;
@end

View File

@ -133,6 +133,9 @@ static void * SDWebImageDownloaderContext = &SDWebImageDownloaderContext;
}
- (void)setValue:(nullable NSString *)value forHTTPHeaderField:(nullable NSString *)field {
if (!field) {
return;
}
NSMutableDictionary *mutableHTTPHeaders = [self.HTTPHeaders mutableCopy];
if (value) {
[mutableHTTPHeaders setObject:value forKey:field];