1
0
mirror of https://github.com/golang/go synced 2024-11-27 05:21:22 -07:00
The Go programming language
Go to file
Damien Neil ede3e278ae [release-branch.go1.20] net/http: permit requests with invalid Host headers
Historically, the Transport has silently truncated invalid
Host headers at the first '/' or ' ' character. CL 506996 changed
this behavior to reject invalid Host headers entirely.
Unfortunately, Docker appears to rely on the previous behavior.

When sending a HTTP/1 request with an invalid Host, send an empty
Host header. This is safer than truncation: If you care about the
Host, then you should get the one you set; if you don't care,
then an empty Host should be fine.

Continue to fully validate Host headers sent to a proxy,
since proxies generally can't productively forward requests
without a Host.

For #60374
Fixes #61431
Fixes #61826

Change-Id: If170c7dd860aa20eb58fe32990fc93af832742b6
Reviewed-on: https://go-review.googlesource.com/c/go/+/511155
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Run-TryBot: Damien Neil <dneil@google.com>
(cherry picked from commit b9153f6ef3)
Reviewed-on: https://go-review.googlesource.com/c/go/+/518756
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Roland Shoemaker <roland@golang.org>
2023-08-14 21:56:57 +00:00
.github .github: suggest using private browsing in pkgsite template 2023-01-03 18:52:47 +00:00
api api: promote next to go1.20 2022-12-07 16:56:12 +00:00
doc [release-branch.go1.20] time: revert strict parsing of RFC 3339 2023-01-18 20:42:20 +00:00
lib/time lib/time: update to 2022g/2022g 2022-12-07 00:25:27 +00:00
misc [release-branch.go1.20] cmd/compile: re-compile instantiated generic methods in linkshared mode 2023-03-29 18:40:30 +00:00
src [release-branch.go1.20] net/http: permit requests with invalid Host headers 2023-08-14 21:56:57 +00:00
test [release-branch.go1.20] cmd/compile: on PPC64, fix sign/zero extension when masking 2023-07-19 19:10:08 +00:00
.gitattributes
.gitignore
codereview.cfg [release-branch.go1.20] update codereview.cfg for release-branch.go1.20 2022-12-07 18:00:33 +00:00
CONTRIBUTING.md
LICENSE
PATENTS
README.md README: update from CC-BY-3.0 to CC-BY-4.0 2022-11-02 20:14:56 +00:00
SECURITY.md
VERSION [release-branch.go1.20] go1.20.7 2023-08-01 19:34:15 +00:00

The Go Programming Language

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.

Gopher image Gopher image by Renee French, licensed under Creative Commons 4.0 Attributions license.

Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.

Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.

Download and Install

Binary Distributions

Official binary distributions are available at https://go.dev/dl/.

After downloading a binary release, visit https://go.dev/doc/install for installation instructions.

Install From Source

If a binary distribution is not available for your combination of operating system and architecture, visit https://go.dev/doc/install/source for source installation instructions.

Contributing

Go is the work of thousands of contributors. We appreciate your help!

To contribute, please read the contribution guidelines at https://go.dev/doc/contribute.

Note that the Go project uses the issue tracker for bug reports and proposals only. See https://go.dev/wiki/Questions for a list of places to ask questions about the Go language.