Commit ad7320ac authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

net/http: document that Handlers are resposible for validating Host headers

Fixes #23993

Change-Id: I112415c894e8c680bfc17d53772275430e46794b
Reviewed-on: https://go-review.googlesource.com/115116Reviewed-by: 's avatarTim Cooper <tim.cooper@layeh.com>
Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 594eae5a
......@@ -214,6 +214,11 @@ type Request struct {
// names, Host may be in Punycode or Unicode form. Use
// golang.org/x/net/idna to convert it to either format if
// needed.
// To prevent DNS rebinding attacks, server Handlers should
// validate that the Host header has a value for which the
// Handler considers itself authoritative. The included
// ServeMux supports patterns registered to particular host
// names and thus protects its registered Handlers.
//
// For client requests Host optionally overrides the Host
// header to send. If empty, the Request.Write method uses
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment