requests icon indicating copy to clipboard operation
requests copied to clipboard

allow string/byte subtypes for header

Open CarliJoy opened this issue 3 years ago • 1 comments

We wrap our secret a in special subclass of string, that prevents leaking confidential information in some circumstances (i.e. stack traces) etc.

The current implementation of the header checks does a type(val) == str which is not recommended by PEP8. Due to this implementation we can't pass this variables as headers. Converting them back to a normal string would defeat the purpose of wrapping them in the first place.

This PR fixes both issues.

CarliJoy avatar Sep 05 '22 13:09 CarliJoy

Related to https://github.com/psf/requests/issues/6159 -> there is also another fix defined there.

CarliJoy avatar Oct 18 '22 09:10 CarliJoy

Resolving as I believe this was fixed in Requests 2.29.0.

nateprewitt avatar Jul 30 '23 01:07 nateprewitt