Host header doesn't match request-authority when using a proxy (RFC 7230#5.4) #92685
Unanswered
TobiasWildbrett
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm facing a problem when trying to send a https request through a proxy using the HttpRequestMessage method in .NET Framework 4.8
The proxy is returning a code 400 bad request, because the value of the Host header in the CONNECT method does not match the request-target. Using curl I'm able to send the identical request.
Using system diagnostics I found that the header is missing the port number:
The proxy is an haproxy, which seems to be very strict in checking this header according to RFC 7230#5.4
Please also refer to the following issue haproxy/haproxy#1159
I tried several ways of working around this issue, like adding the Host header with port in the original request, but I couldn't find a way to modify the header for the CONNECT method.
Also the uri method is removing the port number if it is the default port for the used scheme.
Is there any other way to add the port number to the Header, according to RFC 7230#5.4?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions