You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 13, 2021. It is now read-only.
The HTTP20Connection.request takes a dictionary of headers. This is problematic because, far as I can tell, this prevents the ability to send a request with duplicate headers (multiple header fields with the same name). The spec explicitly allows for duplicate headers. See for example RFC 7541 section 2.3.2:
The dynamic table can contain duplicate entries (i.e., entries with the same name and same value). Therefore, duplicate entries MUST NOT be treated as an error by a decoder.
headers (An iterable of two tuples of bytestrings or HeaderTuple objects.) – The request/response headers to send.
Can request be updated to allow for the same (i.e., an iterable of tuples)? As a suggestion, I believe this can easily be done in the implementation here:
In case this helps someone else: in parallel, I posted a StackOverflow question about this issue to see whether there is a practical work around, and the suggestion which works for me is to use email.Message.EmailMessage:
The HTTP20Connection.request takes a dictionary of headers. This is problematic because, far as I can tell, this prevents the ability to send a request with duplicate headers (multiple header fields with the same name). The spec explicitly allows for duplicate headers. See for example RFC 7541 section 2.3.2:
h2.H2Connection.send_headers addresses this by taking an iterable of tuples, allowing for duplicates:
Can
request
be updated to allow for the same (i.e., an iterable of tuples)? As a suggestion, I believe this can easily be done in the implementation here:hyper/hyper/http20/connection.py
Line 261 in 75f25f7
We can wrap that in a try/except block, handling
AttributeError
to simply setall_headers
toheaders
. Something like:The text was updated successfully, but these errors were encountered: