You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 5, 2021. It is now read-only.
Thanks for reporting the issue and debugging it. It is wrong to skip the custom port in req.Host, but what I find surprising is that this code is not new. We've been using it ourselves for quite some time.
Hi Manu, dug in some more and the Tomcat server is performing a redirection to the same path and just adding headers - hadn't caught that initially. Thanks for taking a look at this!
HTTP spec says that Host header should include port if port is not the default port. Host header's port matters mostly when server redirects the request to another relative URL -- in that case, Go HTTP client uses Host header's value for connection.
Also, add some tests for req.Host behavior.
Fixes: #365
PiperOrigin-RevId: 295666337
The below probe is trying to connect on port 80 - as evidenced in the below log snippet (internal host names redacted):
W0214 20:10:26.962758 216 http.go:212] Target:internal_host3, URL:http://internal_ip3:8080/service-bus, http.doHTTPRequest: Get http://internal_host3/service-bus/: dial tcp internal_ip3:80: connect: connection refused
This appears to be due to https://github.com/google/cloudprober/blob/master/probes/http/request.go#L75, which is setting the Req.Host field to the Target.Name (sans port), which is then being used in https://golang.org/src/net/http/client.go#L569 to overwrite the host from the URL, which had the correct port.
The text was updated successfully, but these errors were encountered: