-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Edit SimpleHttpClient to reference that header keys can be passed as str or bytes #6077
Conversation
changelog.d/6077.bugfix
Outdated
@@ -0,0 +1 @@ | |||
Ensure header dicts passed to SimpleHttpClient using `bytes` instead of `str` for keys. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should match the PR which introduced the bug (#5976)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not quite sure what this is for. AFAIK the SimpleHttpClient methods accept either str
or bytes
for both the header name and the values
Certainly the docstring isn't clear about this, and I wouldn't be hugely averse to us doing a bit of a cleanup on it - but (a) it seems odd to change the header name and not the value, and (b) just changing one header name instance doesn't seem to achieve much.
I've updated the PR to only edit the docstrings now, as I think that would've saved me from this confusion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Header dicts should have bytes as the key in theheaders
dict, not astr
.