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 API that will allow/deny/warn automatic decoding of json based on content-type. #1723

Closed
socketpair opened this issue Mar 17, 2017 · 5 comments
Labels

Comments

@socketpair
Copy link
Contributor

socketpair commented Mar 17, 2017

Now, aiohttp issue warning if await response.json() called and response does not contain correct content-type.
This should be configurable. I suggest to to require content_type.startswith('application/json'). Aiohttp's users must be able to turn this check off and also specify his own MIME-type that should pass this check. I understand, that many broken HTTP-servers give JSON-response without setting correct content-type. I think, we should fight against these servers.

@fafhrd91
Copy link
Member

makes sense

@fafhrd91
Copy link
Member

added

@pnuckowski
Copy link

What about application/vnd.api+json is it correct content-type?

@socketpair
Copy link
Contributor Author

@pnuckowski it is not standard (i.e. RFC recommended) content-type.

@lock
Copy link

lock bot commented Oct 28, 2019

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

@lock lock bot added the outdated label Oct 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants