"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/net/http/httputil/reverseproxy.go" between
go1.16.4.src.tar.gz and go1.16.5.src.tar.gz

About: Google’s Go is a compiled, garbage-collected, concurrent programming language. Latest stable release (1.16).

reverseproxy.go  (go1.16.4.src):reverseproxy.go  (go1.16.5.src)
skipping to change at line 251 skipping to change at line 251
p.Director(outreq) p.Director(outreq)
outreq.Close = false outreq.Close = false
reqUpType := upgradeType(outreq.Header) reqUpType := upgradeType(outreq.Header)
removeConnectionHeaders(outreq.Header) removeConnectionHeaders(outreq.Header)
// Remove hop-by-hop headers to the backend. Especially // Remove hop-by-hop headers to the backend. Especially
// important is "Connection" because we want a persistent // important is "Connection" because we want a persistent
// connection, regardless of what the client sent to us. // connection, regardless of what the client sent to us.
for _, h := range hopHeaders { for _, h := range hopHeaders {
hv := outreq.Header.Get(h)
if hv == "" {
continue
}
if h == "Te" && hv == "trailers" {
// Issue 21096: tell backend applications that
// care about trailer support that we support
// trailers. (We do, but we don't go out of
// our way to advertise that unless the
// incoming client request thought it was
// worth mentioning)
continue
}
outreq.Header.Del(h) outreq.Header.Del(h)
} }
// Issue 21096: tell backend applications that care about trailer support
// that we support trailers. (We do, but we don't go out of our way to
// advertise that unless the incoming client request thought it was worth
// mentioning.) Note that we look at req.Header, not outreq.Header, since
// the latter has passed through removeConnectionHeaders.
if httpguts.HeaderValuesContainsToken(req.Header["Te"], "trailers") {
outreq.Header.Set("Te", "trailers")
}
// After stripping all the hop-by-hop connection headers above, add back any // After stripping all the hop-by-hop connection headers above, add back any
// necessary for protocol upgrades, such as for websockets. // necessary for protocol upgrades, such as for websockets.
if reqUpType != "" { if reqUpType != "" {
outreq.Header.Set("Connection", "Upgrade") outreq.Header.Set("Connection", "Upgrade")
outreq.Header.Set("Upgrade", reqUpType) outreq.Header.Set("Upgrade", reqUpType)
} }
if clientIP, _, err := net.SplitHostPort(req.RemoteAddr); err == nil { if clientIP, _, err := net.SplitHostPort(req.RemoteAddr); err == nil {
// If we aren't the first proxy retain prior // If we aren't the first proxy retain prior
// X-Forwarded-For information as a comma+space // X-Forwarded-For information as a comma+space
 End of changes. 2 change blocks. 
13 lines changed or deleted 9 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)