Like #321, this PR is for the sake of HTTP/2 bootstrap for WebSockets.
This PR makes two changes:
omit :scheme and :path pseudo-headers in Mint.HTTP2.request/5 when the method is "CONNECT"
sort pseudo-headers to the front of the headers list
this allows one to pass pseudo-header(s) to Mint.HTTP2.request/5
For the first part, I was skimming around rfc7540's section on the CONNECT method and found a MUST for CONNECT requests:
The ":scheme" and ":path" pseudo-header fields MUST be omitted.
The second part is for the sake of the WebSocket bootstrap: rfc8441's section on extending the CONNECT method adds "A new pseudo-header field :protocol..." and also says
On requests that contain the :protocol pseudo-header field, the :scheme and :path pseudo-header fields of the target URI (see Section 5) MUST also be included.
The difficulty is that with the current request/5 implementation, the user-agent header gets interspersed between any headers explicitly passed. For example:
Hi again :slightly_smiling_face:
Like #321, this PR is for the sake of HTTP/2 bootstrap for WebSockets.
This PR makes two changes:
:scheme
and:path
pseudo-headers inMint.HTTP2.request/5
when themethod
is"CONNECT"
Mint.HTTP2.request/5
For the first part, I was skimming around rfc7540's section on the CONNECT method and found a MUST for CONNECT requests:
The second part is for the sake of the WebSocket bootstrap: rfc8441's section on extending the CONNECT method adds "A new pseudo-header field :protocol..." and also says
The difficulty is that with the current
request/5
implementation, theuser-agent
header gets interspersed between any headers explicitly passed. For example:Would end up with a set of headers like so:
Which conflicts with rfc7540 section 8.1.2.1 on pseudo-header fields:
With these changes I'm getting some good results sending/receiving frames against an example h2 WebSocket fixture! :tada: