From 190c44b30ae0dc0ccdf9b6d22bd2afdc463072b8 Mon Sep 17 00:00:00 2001 From: Ryan de Gruyter Date: Mon, 9 Oct 2017 13:34:40 +0200 Subject: [PATCH] Add support for Content-Type application/hal+json Currently when the server responds with a content type of application/hal+json, the response might be 200 but the AFNetwork will call the fail callback anyway because the content type is not acceptable. --- src/ios/TextResponseSerializer.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ios/TextResponseSerializer.m b/src/ios/TextResponseSerializer.m index 1ef077c..325f588 100644 --- a/src/ios/TextResponseSerializer.m +++ b/src/ios/TextResponseSerializer.m @@ -23,7 +23,7 @@ static BOOL AFErrorOrUnderlyingErrorHasCodeInDomain(NSError *error, NSInteger co return nil; } - self.acceptableContentTypes = [NSSet setWithObjects:@"text/plain", @"text/html", @"text/json", @"application/json", @"text/xml", @"application/xml", @"text/css", nil]; + self.acceptableContentTypes = [NSSet setWithObjects:@"text/plain", @"text/html", @"text/json", @"application/hal+json", @"application/json", @"text/xml", @"application/xml", @"text/css", nil]; return self; } @@ -55,4 +55,4 @@ static BOOL AFErrorOrUnderlyingErrorHasCodeInDomain(NSError *error, NSInteger co return responseString; } -@end \ No newline at end of file +@end