|
|
@@ -257,7 +257,7 @@ final class ContentTypeValidationTestCase: BaseTestCase {
|
|
|
var requestError: AFError?
|
|
|
var downloadError: AFError?
|
|
|
|
|
|
- let acceptableContentTypes = [ // Sorted in a random order, not alphabetically
|
|
|
+ let acceptableContentTypes = [// Sorted in a random order, not alphabetically
|
|
|
"application/octet-stream",
|
|
|
"image/gif",
|
|
|
"image/x-xbitmap",
|
|
|
@@ -271,8 +271,7 @@ final class ContentTypeValidationTestCase: BaseTestCase {
|
|
|
"image/ico",
|
|
|
"image/bmp",
|
|
|
"image/x-ms-bmp",
|
|
|
- "image/x-win-bitmap"
|
|
|
- ]
|
|
|
+ "image/x-win-bitmap"]
|
|
|
|
|
|
// When
|
|
|
AF.request(endpoint)
|
|
|
@@ -295,22 +294,21 @@ final class ContentTypeValidationTestCase: BaseTestCase {
|
|
|
XCTAssertNotNil(requestError)
|
|
|
XCTAssertNotNil(downloadError)
|
|
|
|
|
|
- let expectedAcceptableContentTypes = [ // Sorted in a specific order, alphabetically
|
|
|
- "application/octet-stream",
|
|
|
- "image/bmp",
|
|
|
- "image/gif",
|
|
|
- "image/ico",
|
|
|
- "image/jp2",
|
|
|
- "image/jpeg",
|
|
|
- "image/jpg",
|
|
|
- "image/png",
|
|
|
- "image/tiff",
|
|
|
- "image/x-bmp",
|
|
|
- "image/x-icon",
|
|
|
- "image/x-ms-bmp",
|
|
|
- "image/x-win-bitmap",
|
|
|
- "image/x-xbitmap",
|
|
|
- ]
|
|
|
+ let expectedAcceptableContentTypes = [// Sorted in a specific order, alphabetically
|
|
|
+ "application/octet-stream",
|
|
|
+ "image/bmp",
|
|
|
+ "image/gif",
|
|
|
+ "image/ico",
|
|
|
+ "image/jp2",
|
|
|
+ "image/jpeg",
|
|
|
+ "image/jpg",
|
|
|
+ "image/png",
|
|
|
+ "image/tiff",
|
|
|
+ "image/x-bmp",
|
|
|
+ "image/x-icon",
|
|
|
+ "image/x-ms-bmp",
|
|
|
+ "image/x-win-bitmap",
|
|
|
+ "image/x-xbitmap"]
|
|
|
|
|
|
for error in [requestError, downloadError] {
|
|
|
XCTAssertEqual(error?.isUnacceptableContentType, true)
|