Skip to content

Conversation

@nollium
Copy link

@nollium nollium commented Apr 25, 2023

The header is parsed into a CaseInsensitiveDict which keys are specified to be strings, but it was here set to bytes. https://github.com/psf/requests/blob/51716c4ef390136b0d4b800ec7665dd5503e64fc/requests/structures.py#L20

This fix removes the encoding that converted the parsed keys back to bytes.

The header is parsed into a CaseInsensitiveDict which keys are specified to be expected to be strings, but it was here set to bytes.
https://github.com/psf/requests/blob/main/requests/structures.py#:~:text=All%20keys%20are%20expected%20to%20be%20strings.%20The%20structure%20remembers%20the

This fix removes that encoding that converted the parsed key back to bytes.
@John-P
Copy link

John-P commented Feb 22, 2024

Is this repo still active? I just came across this today and can confirm that it is still an issue. It would be nice to fix this annoying bug, especially as it is a recommended package by requests.

@sigmavirus24
Copy link
Collaborator

There's no test for this fix to ensure it won't regress. The repository is still maintained but changes need tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants