Merge pull request #937 from RobotsAndPencils/upstream
allHeaderFields invalid for NSURLResponse to file:/// url
This commit is contained in:
commit
618765b5a9
@ -165,7 +165,7 @@ static void AFSwizzleClassMethodWithClassAndSelectorUsingBlock(Class klass, SEL
|
||||
- (NSStringEncoding)responseStringEncoding {
|
||||
// When no explicit charset parameter is provided by the sender, media subtypes of the "text" type are defined to have a default charset value of "ISO-8859-1" when received via HTTP. Data in character sets other than "ISO-8859-1" or its subsets MUST be labeled with an appropriate charset value.
|
||||
// See http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.4.1
|
||||
if (self.response && !self.response.textEncodingName && self.responseData) {
|
||||
if (self.response && !self.response.textEncodingName && self.responseData && [self.response respondsToSelector:@selector(allHeaderFields)]) {
|
||||
NSString *type = nil;
|
||||
AFGetMediaTypeAndSubtypeWithString([[self.response allHeaderFields] valueForKey:@"Content-Type"], &type, nil);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user