Fix duplicate headers when dispatching WebHooks.
Review Request #11613 — Created May 24, 2021 and submitted
When building a request during WebHook dispatch, we were using legacy
byte strings for headers. This almost sort of worked on Python 3, except
that duplicateContent-Type
andContent-Length
headers would appear,
and this would generally break request handling on the target server.We needed to use native strings instead, to get the right behavior on
Python 2 and 3. This change updates request building to do this
correctly, and to updates tests to properly check the headers against
the right types.
Unit tests pass on Python 2.7 and 3.x.
Confirmed the bug against a WebHook endpoint on requestbin.net, and
confirmed the fix worked against the same endpoint, without any
duplicate headers.
Summary | ID |
---|---|
04e0cec766df623f52326c20d5a69d2512fc80c2 |
- Description:
-
When building a request during WebHook dispatch, we were using legacy
byte strings for headers. This almost sort of worked on Python 3, except that duplicate Content-Type
andContent-Length
headers would appear,and this would generally break request handling on the target server. We needed to use native strings instead, to get the right behavior on
Python 2 and 3. This change updates request building to do this correctly, and to updates tests to properly check the headers against the right types. - - Fixes bug #4923.
- Bugs: