Conversation
|
Review requested:
|
987fc94 to
8172f67
Compare
Codecov Reportβ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #64876 +/- ##
==========================================
- Coverage 90.29% 90.26% -0.04%
==========================================
Files 760 789 +29
Lines 247061 271499 +24438
Branches 46584 51818 +5234
==========================================
+ Hits 223096 245064 +21968
- Misses 15437 16902 +1465
- Partials 8528 9533 +1005
π New features to boost your workflow:
|
Signed-off-by: Efe Karasakal <hi@efe.dev>
7cb68d6 to
673924c
Compare
|
Sorry it's taken me so long to get to this. I've put some comments here, but I think generally I'm -0.5 on this. As is, I think it can be a breaking change, and the upside is quite small. More broadly, it changes the scope of HTTP validation we do in these APIs. Right now we don't do anything similar for other methods - we enforce syntactic correctness (no unescaped spaces, must be correctly framed & parseable) but we don't generally police anything else beyond that. If you want to send random strings as a cookie header, or send We could change that, it's an interesting idea, but if we're going to break this we might as well do something much larger. And to be honest I think it's not helpful: there's plenty of use cases for sending weird HTTP, notably including testing that your server correctly rejects it. This fits into a broader discussion about I think there's a central core we can do here safely and sensibly, roughly: if you specifically pass a URL as the request target and the method is CONNECT, then use the path without any leading slash as the target. No new errors or further validation. The risk of breakage there I think is much smaller (URL usage like this is quite unusual anyway, the correct behaviour was always ambiguous, and it'd only break for servers who exclusively accept the wrong format) and it solves the original issue. What do you think @efekrskl? |
|
@pimterry thanks for the detailed review! Good points, and I agree. I've narrowed down the change quite a bit to only strip the leading slash from URL derived CONNECT targets. This should keep the fix as surgical as possible while still solving the original issue. |
Fixes #34347
Partially a revival of #34412 which was apparently moving in the right direction but got stalled and closed