Skip to content

Add API that will allow/deny/warn automatic decoding of json based on content-type. #1723

Closed
@socketpair

Description

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.

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions