mirror of
https://github.com/httpie/cli.git
synced 2024-11-30 08:46:48 +02:00
147a066dbe
* Support `requests.response.raw` being a file-like object Previously HTTPie relied on `requests.models.Response.raw` being `urllib3.HTTPResponse`. The `requests` documentation specifies that (requests.models.Response.raw)[https://docs.python-requests.org/en/master/api/#requests.Response.raw] is a file-like object but allows for other types for internal use. This change introduces graceful handling for scenarios when `requests.models.Response.raw` is not `urllib3.HTTPResponse`. In such a scenario HTTPie now falls back to extracting metadata from `requests.models.Response` directly instead of direct access from protected protected members such as `response.raw._original_response`. A side effect in this fallback procedure is that we can no longer determine HTTP protocol version and report it as `1.1`. This change is necessary to make it possible to implement `TransportPlugins` without having to also needing to emulate internal behavior of `urlib3` and `http.client`. * Load cookies from `response.headers` instead of `response.raw._original_response.msg._headers` `response.cookies` was not utilized as it not possible to construct original payload from `http.cookiejar.Cookie`. Data is stored in lossy format. For example `Cookie.secure` defaults to `False` so we cannot distinguish if `Cookie.secure` was set to `False` or was not set at all. Same problem applies to other fields also. * Simpler HTTP envelope data extraction * Test cookie extraction and make cookie presentment backwards compatible Co-authored-by: Mickaël Schoentgen <contact@tiger-222.fr> Co-authored-by: Jakub Roztocil <jakub@roztocil.co> |
||
---|---|---|
.. | ||
client_certs | ||
fixtures | ||
utils | ||
__init__.py | ||
conftest.py | ||
README.rst | ||
test_auth_plugins.py | ||
test_auth.py | ||
test_binary.py | ||
test_cli.py | ||
test_compress.py | ||
test_config.py | ||
test_cookie.py | ||
test_defaults.py | ||
test_docs.py | ||
test_downloads.py | ||
test_errors.py | ||
test_exit_status.py | ||
test_httpie.py | ||
test_offline.py | ||
test_output.py | ||
test_redirects.py | ||
test_regressions.py | ||
test_sessions.py | ||
test_ssl.py | ||
test_stream.py | ||
test_tokens.py | ||
test_transport_plugin.py | ||
test_unicode.py | ||
test_uploads.py | ||
test_windows.py |
HTTPie Test Suite ================= Please see `CONTRIBUTING`_. .. _CONTRIBUTING: https://github.com/httpie/httpie/blob/master/CONTRIBUTING.rst