forked from extern/httpie-cli
6bd6648545
We were using the potential `encoding` returned by `mimetypes.guess_type()`
to expand the `Content-Type` header.
According to the RFC-7231 [1] the `Content-Type` should contain a charset
and nothing more. But as stated in the `mimetypes.guess_type()` doc [2],
the `encoding` would be the name of the program used to encode (e.g. compress
or gzip) the payload. The `encoding` is suitable for use as a `Content-Encoding`
header. See [3] for potential `encoding`s, none is a IANA registered one [4], and
so a valid charset to be used by the `Content-Type` header.
[1] https://httpwg.org/specs/rfc7231.html#header.content-type
[2] https://docs.python.org/3/library/mimetypes.html#guess_type
[3]
|
||
---|---|---|
.. | ||
cli | ||
output | ||
plugins | ||
__init__.py | ||
__main__.py | ||
client.py | ||
compat.py | ||
config.py | ||
constants.py | ||
context.py | ||
core.py | ||
downloads.py | ||
models.py | ||
sessions.py | ||
ssl.py | ||
status.py | ||
uploads.py | ||
utils.py |