Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "image/jpg" to the list of acceptableContentTypes #29

Closed
Codeglee opened this issue Oct 7, 2015 · 3 comments
Closed

Add "image/jpg" to the list of acceptableContentTypes #29

Codeglee opened this issue Oct 7, 2015 · 3 comments

Comments

@Codeglee
Copy link

Codeglee commented Oct 7, 2015

I'm not sure why it isn't already in the list but please add "image/jpg" here:

`private class func validateResponse(response: NSHTTPURLResponse?) -> Bool {

    let acceptableContentTypes: Set<String> = [
        "image/tiff",
        "image/jpeg",
        "image/gif",
        "image/png",
        "image/ico",
        "image/x-icon",
        "image/bmp",
        "image/x-bmp",
        "image/x-xbitmap",
        "image/x-win-bitmap"
    ]`

It's in Request+AlamofireImage.swift.

"image/jpg" is a valid content type and behaves identically to "image/jpeg".

Thanks.

@cnoon
Copy link
Member

cnoon commented Oct 7, 2015

Hi @Codeglee, image/jpg is not a valid MIME type, but it is used as a content-type all over the place incorrectly. We need to make some changes to AFI to allow users to add additional acceptable content types. See #28 for more information.

I'll most likely be making some changes here soon (next couple days) to make this much easier to customize.

@cnoon cnoon self-assigned this Oct 7, 2015
@cnoon cnoon added this to the 2.0.0 milestone Oct 7, 2015
@Codeglee
Copy link
Author

Codeglee commented Oct 7, 2015

Hey @cnoon,

You're right, I mistook ubiquity for standards compliance.

I'm sure others are in the same place we are, having to consume third party APIs that aren't compliant.

Any extensibility points you add to resolve this scenario would be fine. For the moment I've just branched the code but will keep an eye out for updates.

cnoon added a commit that referenced this issue Oct 10, 2015
This change addresses the challenges faced in both #28 and #29.
@cnoon
Copy link
Member

cnoon commented Oct 10, 2015

Pull request #33 adds the ability to specify additional acceptable image content types for a Request. I'm going to close this issue out. Please redirect all further comments to #33.

@cnoon cnoon closed this as completed Oct 10, 2015
@cnoon cnoon mentioned this issue Sep 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants