Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Commit

Permalink
httpcache: Update gofmt
Browse files Browse the repository at this point in the history
Generated with:

  $ gofmt -s -w *.go */*.go

using:

  $ go version
  go version go1.10.3 linux/amd64
  • Loading branch information
wking committed Nov 7, 2018
1 parent 118c0b1 commit 9f73bc1
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions httpcache.go
Original file line number Diff line number Diff line change
Expand Up @@ -416,14 +416,14 @@ func canStaleOnError(respHeaders, reqHeaders http.Header) bool {
func getEndToEndHeaders(respHeaders http.Header) []string {
// These headers are always hop-by-hop
hopByHopHeaders := map[string]struct{}{
"Connection": struct{}{},
"Keep-Alive": struct{}{},
"Proxy-Authenticate": struct{}{},
"Proxy-Authorization": struct{}{},
"Te": struct{}{},
"Trailers": struct{}{},
"Transfer-Encoding": struct{}{},
"Upgrade": struct{}{},
"Connection": {},
"Keep-Alive": {},
"Proxy-Authenticate": {},
"Proxy-Authorization": {},
"Te": {},
"Trailers": {},
"Transfer-Encoding": {},
"Upgrade": {},
}

for _, extra := range strings.Split(respHeaders.Get("connection"), ",") {
Expand All @@ -433,7 +433,7 @@ func getEndToEndHeaders(respHeaders http.Header) []string {
}
}
endToEndHeaders := []string{}
for respHeader, _ := range respHeaders {
for respHeader := range respHeaders {
if _, ok := hopByHopHeaders[respHeader]; !ok {
endToEndHeaders = append(endToEndHeaders, respHeader)
}
Expand Down

0 comments on commit 9f73bc1

Please sign in to comment.