fix #58: white-list of allowed content-types should be removed for iOS

This commit is contained in:
Sefa Ilkimen
2018-01-04 02:05:55 +01:00
parent 73097b9db9
commit 64731a3794
3 changed files with 13 additions and 1 deletions
+1
View File
@@ -4,6 +4,7 @@
- Fixed #45: does not encode arrays correctly as HTTP GET parameter on Android
- Fixed #54: requests are not responding on iOS with non-string values in header object
- Fixed #58: white-list of allowed content-types should be removed for iOS
## v1.9.0
+2 -1
View File
@@ -19,11 +19,12 @@ static BOOL AFErrorOrUnderlyingErrorHasCodeInDomain(NSError *error, NSInteger co
- (instancetype)init {
self = [super init];
if (!self) {
return nil;
}
self.acceptableContentTypes = [NSSet setWithObjects:@"text/plain", @"text/html", @"text/json", @"application/hal+json", @"application/json", @"text/xml", @"application/xml", @"text/css", @"application/javascript", nil];
self.acceptableContentTypes = nil;
return self;
}
+10
View File
@@ -302,6 +302,16 @@ const tests = [
result.type.should.be.equal('throwed');
result.message.should.be.equal('advanced-http: header values must be strings');
}
},{
description: 'should accept content-type "application/xml" #58',
expected: 'resolved: {"status": 200, ...',
func: function(resolve, reject) {
cordova.plugin.http.get('http://httpbin.org/xml', {}, {}, resolve, reject);
},
validationFunc: function(driver, result) {
result.type.should.be.equal('resolved');
result.data.status.should.be.equal(200);
}
}
];