Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Response.headers loses data on multiple values #5515

Closed
Gallaecio opened this issue Jun 6, 2022 · 0 comments · Fixed by #5526
Closed

Response.headers loses data on multiple values #5515

Gallaecio opened this issue Jun 6, 2022 · 0 comments · Fixed by #5526
Labels

Comments

@Gallaecio
Copy link
Member

#1262 reported that by default response.headers would only expose the first value of a header e.g. when casted as a dict, acknowledging that response.headers.getlist could be used instead to get all values.

I have just found out that the latter is not true:

>>> from scrapy.http import Response
>>> response = Response("https://example.com", headers=(("a", "b"), ("a", "c")))
>>> response.headers.getlist("a")
[b'c']

I could verify the issue happening as far back as Scrapy 1.6, so it does not look like a recent bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant