Backport of NET-4897 - update comment to include the current issue url from the go team. into release/1.15.x (#18265)

backport of commit 23f0cfc2d6

Co-authored-by: John Murret <john.murret@hashicorp.com>
pull/18277/head
hc-github-team-consul-core 1 year ago committed by GitHub
parent 3425e655b6
commit 606452e2fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -989,8 +989,10 @@ func (r *request) toHTTP() (*http.Request, error) {
// this is required since go started validating req.host in 1.20.6 and 1.19.11. // this is required since go started validating req.host in 1.20.6 and 1.19.11.
// prior to that they would strip out the slashes for you. They removed that // prior to that they would strip out the slashes for you. They removed that
// behavior and added more strict validation as part of a CVE. // behavior and added more strict validation as part of a CVE.
// https://github.com/golang/go/issues/60374 // This issue is being tracked by the Go team:
// the hope is that // https://github.com/golang/go/issues/61431
// If there is a resolution in this issue, we will remove this code.
// In the time being, this is the accepted workaround.
if strings.HasPrefix(r.url.Host, "/") { if strings.HasPrefix(r.url.Host, "/") {
r.url.Host = "localhost" r.url.Host = "localhost"
} }

Loading…
Cancel
Save