From 4d23411d80a119b27310625f219b0c1506e08f73 Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Sat, 23 Feb 2019 00:29:09 +0100 Subject: [PATCH] comments --- common/protocol/http/headers.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/protocol/http/headers.go b/common/protocol/http/headers.go index 1eb7a84cf..db497ac44 100644 --- a/common/protocol/http/headers.go +++ b/common/protocol/http/headers.go @@ -8,6 +8,7 @@ import ( "v2ray.com/core/common/net" ) +// ParseXForwardedFor parses X-Forwarded-For header in http headers, and return the IP list in it. func ParseXForwardedFor(header http.Header) []net.Address { xff := header.Get("X-Forwarded-For") if len(xff) == 0 { @@ -21,6 +22,7 @@ func ParseXForwardedFor(header http.Header) []net.Address { return addrs } +// RemoveHopByHopHeaders remove hop by hop headers in http header list. func RemoveHopByHopHeaders(header http.Header) { // Strip hop-by-hop header based on RFC: // http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.5.1