Skip to content

[BUG] Request headers not set in the response #368

@IV1T3

Description

@IV1T3

Describe the bug
The request headers are not set in the response object. As shown in the example below, even though request headers were sent, the Headers object is empty in the response.

To Reproduce

>>> from curl_cffi import requests
>>> res = requests.get("https://httpbin.org/headers")
>>> res.json()
{'headers': {'Accept': '*/*', 'Accept-Encoding': 'gzip, deflate, br, zstd', 'Host': 'httpbin.org', 'X-Amzn-Trace-Id': 'Root=1-66b8ff1e-50969ef8662112f677a6f081'}}
>>> res.request.__dict__
{'url': 'https://httpbin.org/headers', 'headers': Headers({}), 'method': 'GET'}

This also happens using a Session

Expected behavior
I expect the headers to be set.

Versions

  • curl_cffi '0.7.1'

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions