You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
raiseValueError("charset must not be in content_type "
"argument")
aiohttp just checks for a semicolon instead for the actual word charset.
Steps to reproduce
>>> from aiohttp.web import Response
>>> Response(text="hello", content_type="text/plain; version=0.0.4", charset="utf-8")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/hynek/.virtualenvs/prometheus_async/lib/python3.6/site-packages/aiohttp/web_response.py", line 451, in __init__
raise ValueError("charset must not be in content_type "
ValueError: charset must not be in content_type argument
charset must not be in content_type argument
The text was updated successfully, but these errors were encountered:
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].
[new issue]: https://github.com/aio-libs/aiohttp/issues/new
Long story short
The presence of a
;
in a content type does not mean that it contains a charset.Expected behaviour
Only complain about charsets if there's a charset in content_type.
Actual behaviour
text/plain; version=0.0.4
will raise anValueError: charset must not be in content_type argument
.The problem are these lines:
aiohttp/aiohttp/web_response.py
Lines 456 to 458 in 4b498d1
aiohttp just checks for a semicolon instead for the actual word
charset
.Steps to reproduce
The text was updated successfully, but these errors were encountered: