MCPcopy
hub / github.com/caddyserver/caddy / removeConnectionHeaders

Function removeConnectionHeaders

modules/caddyhttp/reverseproxy/reverseproxy.go:1587–1595  ·  view source on GitHub ↗

removeConnectionHeaders removes hop-by-hop headers listed in the "Connection" header of h. See RFC 7230, section 6.1

(h http.Header)

Source from the content-addressed store, hash-verified

1585// removeConnectionHeaders removes hop-by-hop headers listed in the "Connection" header of h.
1586// See RFC 7230, section 6.1
1587func removeConnectionHeaders(h http.Header) {
1588 for _, f := range h["Connection"] {
1589 for sf := range strings.SplitSeq(f, ",") {
1590 if sf = textproto.TrimString(sf); sf != "" {
1591 h.Del(sf)
1592 }
1593 }
1594 }
1595}
1596
1597// statusError returns an error value that has a status code.
1598func statusError(err error) error {

Callers 2

prepareRequestMethod · 0.85
finalizeResponseMethod · 0.85

Calls 1

DelMethod · 0.80

Tested by

no test coverage detected