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

Any media type starting with application/json treated as JSON #5896

Closed
1 task done
scop opened this issue Jul 18, 2021 · 3 comments · Fixed by #6180
Closed
1 task done

Any media type starting with application/json treated as JSON #5896

scop opened this issue Jul 18, 2021 · 3 comments · Fixed by #6180
Labels

Comments

@scop
Copy link
Contributor

scop commented Jul 18, 2021

Describe the bug

Any media type that starts with application/json is treated as JSON. This treatment should be limited to application/json and types with +json media type suffix. An example of a registered media type that triggers this problem is https://www.iana.org/assignments/media-types/application/json-seq

To Reproduce

PR #5895 has a failing test case.

Expected behavior

Not anything that begins with application/json should be treated as JSON.

Logs/tracebacks

-

Python Version

$ python --version
Python 3.9.6

aiohttp Version

$ python -m pip show aiohttp
WARNING: Package(s) not found: aiohttp

(current git master)

multidict Version

$ python -m pip show multidict
Name: multidict
Version: 5.1.0
Summary: multidict implementation
Home-page: https://github.com/aio-libs/multidict
Author: Andrew Svetlov
Author-email: andrew.svetlov@gmail.com
License: Apache 2
Location: /home/scop/.pyenv/versions/3.9.6/envs/aiohttp/lib/python3.9/site-packages
Requires: 
Required-by: yarl

yarl Version

$ python -m pip show yarl
Version: 1.6.3
Summary: Yet another URL library
Home-page: https://github.com/aio-libs/yarl/
Author: Andrew Svetlov
Author-email: andrew.svetlov@gmail.com
License: Apache 2
Location: /home/scop/.pyenv/versions/3.9.6/envs/aiohttp/lib/python3.9/site-packages
Requires: multidict, idna
Required-by:

OS

Any

Related component

Client

Additional context

No response

Code of Conduct

  • I agree to follow the aio-libs Code of Conduct
@scop scop added the bug label Jul 18, 2021
@asvetlov
Copy link
Member

Fixed by #5894

@scop
Copy link
Contributor Author

scop commented Oct 31, 2021

As mentioned in #5895 (comment), this is a different thing, not fixed by #5894. The test case in #5895 still fails.

@scop
Copy link
Contributor Author

scop commented Oct 31, 2021

Real fix in #6180.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants