-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support the CONNECT method #2761
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
@googlebot I signed it! |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
Codecov Report
@@ Coverage Diff @@
## master #2761 +/- ##
==========================================
+ Coverage 86.52% 86.69% +0.17%
==========================================
Files 128 128
Lines 9960 10013 +53
==========================================
+ Hits 8617 8680 +63
+ Misses 1010 1006 -4
+ Partials 333 327 -6
Continue to review full report at Codecov.
|
I don't understand this warning, "string |
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.
Thank you @klzgrad! This looks very good to me, I just found two very minor nits (see comments).
I also have a few questions from reading the spec:
- The ":authority" pseudo-header field contains the host and port to connect to (equivalent to the authority-form of the request-target of CONNECT requests; see Section 3.2.3 of [HTTP11])
We're currently just copying over the :authority
field. Am I right to assume that the upstream proxy implementation will perform a check that this field actually contains a host and port?
Furthermore, I'm wondering about this paragraph:
Once the CONNECT method has completed, only DATA frames are permitted to be sent on the stream. Extension frames MAY be used if specifically permitted by the definition of the extension. Receipt of any other frame type MUST be treated as a connection error of type H3_FRAME_UNEXPECTED.
Do we need to check for this?
caddyserver/forwardproxy does this. In abstract, we are passing a host and port in a single authority string to the upstream proxy, and to actually perform the connection the proxy always has to first parse the string into a host and port. Checking its validity seems more suitable in that place.
Currently checking of this part is done in this code, Not strictly conforming, as it merely ignores HEADERS frame, but the non-conformance is on the same level with regular HTTP requests. As in https://tools.ietf.org/id/draft-ietf-quic-http-29.html#section-4.1-6:
I hope fixing all that won't be required in this PR. |
That makes sense. We can fix that in a separate issue. |
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 now. Thank you @klzgrad!
Fix #2748.