net/http/httputil: docs about X-Forwarded-For in ReverseProxy

This commit is contained in:
Kévin Dunglas 2020-01-21 15:27:02 +01:00
parent 71239b4f49
commit 2b1023f915
No known key found for this signature in database
GPG Key ID: 9D0C5D6EEB42C445
1 changed files with 7 additions and 0 deletions

View File

@ -24,6 +24,13 @@ import (
// ReverseProxy is an HTTP Handler that takes an incoming request and
// sends it to another server, proxying the response back to the
// client.
// ReverseProxy automatically sets the client IP as value of the
// X-Forwarded-For header.
// If a X-Forwarded-For header already exists, the client IP is
// appended to existing values.
// To prevent IP spoofing, be sure to delete any pre-existing
// X-Forwarded-For header comming from the client or
// an untrusted proxy.
type ReverseProxy struct {
// Director must be a function which modifies
// the request into a new request to be sent