mirror of
https://github.com/httpie/cli.git
synced 2024-11-22 07:43:20 +01:00
14 lines
448 B
Python
14 lines
448 B
Python
|
from httpie.cli.dicts import HTTPHeadersDict
|
||
|
from requests.adapters import HTTPAdapter
|
||
|
|
||
|
|
||
|
class HTTPieHTTPAdapter(HTTPAdapter):
|
||
|
|
||
|
def build_response(self, req, resp):
|
||
|
"""Wrap the original headers with the `HTTPHeadersDict`
|
||
|
to preserve multiple headers that have the same name"""
|
||
|
|
||
|
response = super().build_response(req, resp)
|
||
|
response.headers = HTTPHeadersDict(getattr(resp, 'headers', {}))
|
||
|
return response
|