Skip to content

Instantly share code, notes, and snippets.

@alfonmga
Created September 15, 2021 21:18
Show Gist options
  • Save alfonmga/df7d4d30d5fddb03addf8354a4e49352 to your computer and use it in GitHub Desktop.
Save alfonmga/df7d4d30d5fddb03addf8354a4e49352 to your computer and use it in GitHub Desktop.
// Hop-by-hop headers. These are removed when sent to the backend.
// http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html
var hopHeaders = []string{
"Connection",
"Keep-Alive",
"Proxy-Authenticate",
"Proxy-Authorization",
"Te", // canonicalized version of "TE"
"Trailers",
"Transfer-Encoding",
"Upgrade",
}
func delHopHeaders(header http.Header) {
for _, h := range hopHeaders {
header.Del(h)
}
}
func copyHeader(dst, src http.Header) {
for k, vv := range src {
for _, v := range vv {
dst.Add(k, v)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment