Adding early return for hasAcceptableContentType
This commit is contained in:
parent
cdbae5a9fb
commit
e445903901
1 changed files with 6 additions and 3 deletions
|
|
@ -173,8 +173,7 @@ static NSString * AFStringFromIndexSet(NSIndexSet *indexSet) {
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)hasAcceptableStatusCode {
|
- (BOOL)hasAcceptableStatusCode {
|
||||||
if(!self.response) {
|
if (!self.response) {
|
||||||
// no response means network failure or such
|
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -183,6 +182,10 @@ static NSString * AFStringFromIndexSet(NSIndexSet *indexSet) {
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)hasAcceptableContentType {
|
- (BOOL)hasAcceptableContentType {
|
||||||
|
if (!self.response) {
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
return ![[self class] acceptableContentTypes] || [[[self class] acceptableContentTypes] containsObject:[self.response MIMEType]];
|
return ![[self class] acceptableContentTypes] || [[[self class] acceptableContentTypes] containsObject:[self.response MIMEType]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue