From 94bbe4c1e8e413e37a78c48df1b1623c416d9755 Mon Sep 17 00:00:00 2001 From: Mattt Thompson Date: Mon, 17 Sep 2012 09:37:33 -0700 Subject: [PATCH] [Issue #521] Fixing AFContentTypesFromHTTPHeader to correctly handle comma-delimited content types --- AFNetworking/AFHTTPRequestOperation.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/AFNetworking/AFHTTPRequestOperation.m b/AFNetworking/AFHTTPRequestOperation.m index 398a9b8..6af2276 100644 --- a/AFNetworking/AFHTTPRequestOperation.m +++ b/AFNetworking/AFHTTPRequestOperation.m @@ -49,6 +49,8 @@ NSSet * AFContentTypesFromHTTPHeader(NSString *string) { NSString *contentType = nil; if ([scanner scanUpToString:@";" intoString:&contentType]) { [scanner scanUpToString:@"," intoString:nil]; + } else { + [scanner scanUpToCharactersFromSet:_skippedCharacterSet intoString:&contentType]; } if (contentType) {