Skip to content

Commit

Permalink
Backport of NET-4897 - update comment to include the current issue ur…
Browse files Browse the repository at this point in the history
…l from the go team. into release/1.16.x (#18266)

backport of commit 23f0cfc

Co-authored-by: John Murret <john.murret@hashicorp.com>
  • Loading branch information
hc-github-team-consul-core and jmurret committed Aug 3, 2023
1 parent 53355c8 commit e6e7ad7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -1005,8 +1005,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.
// 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.
// https://github.com/golang/go/issues/60374
// the hope is that
// This issue is being tracked by the Go team:
// 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, "/") {
r.url.Host = "localhost"
}
Expand Down

0 comments on commit e6e7ad7

Please sign in to comment.