-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Motivation: According to RFC7230 section 5.4 (https://datatracker.ietf.org/doc/html/rfc7230#section-5.4), all HTTP/1.1 requests must contain the `Host` header. If the target URI includes an authority component, then a client MUST send a field-value for Host that is identical to that authority component. On the other hand, `content-length: 0` header is not required because request payload body is not expected: https://datatracker.ietf.org/doc/html/rfc9110#section-9.3.6 Modifications: - Enhance `ProxyTunnel` to parse and validate initial line and the host header before passing data to `handler`, return 400 if it finds an error in request; - Update `ProxyConnectConnectionFactoryFilter` to remove `content-lenght: 0` and add `host` header; - Use `BuilderUtils` in `HttpsProxyTest` to allow enabling wire logging via system properties; Result: `CONNECT` request follows RFC guidelines and examples.
- Loading branch information
1 parent
2d1c8ca
commit 6b30d63
Showing
3 changed files
with
102 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters