fix(client): Do not strip `path` and `scheme` components from URIs for HTTP/2 Extended CONNECT requests
As per RFC 8441:
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.
I was trying to implement WebSocket handshake based on HTTP/2 Extended CONNECT. The current implementation crafted a request which was considered invalid by the server (HAProxy 2.8):
Compared to the example illustrated in RFC 8441, the pseudo headers :scheme and :path were missing.
After the fix, the client could successfully establish a WebSocket tunnel to the server.
Hi @nox , can I nudge a little bit for reviewing this PR?👀
@nox I have added two integrations tests for client CONNECT requests.
@seanmonstar Since the Extended CONNECT requests only apply to h2, I've made a few changes to the helper macro in the integration test so that certain tests will not run in http/1 mode. Please take a look and see if you are okay with this approach. Thanks!
I'm happy to get this in with the test, thanks so much! Looks like CI noticed a combination of features that fail to compile, so probably a cfg(feature = ...) flag is needed in a new place.
@seanmonstar I've updated it with the feature flags. Hopefully it will pass this time.
Thank you for being patient with us!
Shouldn't these changes be reflected in 1.0.0 version? (or perhaps hyper-utils)
I'm a bit concerned that some changes may be missed in the newer versions
cc @seanmonstar
Yes, a similar thing could be made a PR to https://github.com/hyperium/hyper-util