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

fix has_manifest for 404 responses - do not evaluate_media_type() #176

Merged
merged 1 commit into from
Sep 11, 2020

Conversation

edwardgeorge
Copy link
Contributor

If getting a 404 response when calling has_manifest then if the content-type returned for the json error body is application/json; charset=utf-8 then the call to evaluate_media_type will fail with a strum error because it does not expect the charset=utf-8 param to be valid here. see discussion in: #113

This change follows the approach taken in other methods above which is to match on status before continuing to inspect the media type.

Copy link
Contributor

@steveej steveej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this contribution @edwardgeorge!

I took the liberty to push some opinionated style changes directly to your fork as it seems easier to read for me that way. Please squash the commit into yours if you like it, otherwise feel free to drop it. Either way I'll merge the PR once you tell me to 😉

@steveej steveej self-assigned this Sep 11, 2020
If getting a 404 response when calling 'has_manifest' then if the content-type
returned for the json error body is 'application/json; charset=utf-8'
then the call to 'evaluate_media_type' will fail because it does not expect
charset=utf-8 to be valid here. see discussion in:
camallo#113

This change follows the approach taken in other methods above which is to
match on 'status' before continuing.
@edwardgeorge
Copy link
Contributor Author

@steveej yep, those changes make sense. I have gone ahead and squashed them, feel free to merge.

@steveej steveej merged commit 73bc9e4 into camallo:master Sep 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants