Skip to content

Commit

Permalink
Merge branch 'travis-go-bump'
Browse files Browse the repository at this point in the history
gregjones#92

* travis-go-bump:
  .travis.yml: Only run 'gofmt' on 1.11.x
  httpcache: Update gofmt
  Revert "Remove simplify-code option, for now"
  .travis.yml: Bump to modern Go (1.11)
  • Loading branch information
wking committed Nov 9, 2018
2 parents 391a9f2 + d5cd581 commit 546c9f7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
13 changes: 6 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
sudo: false
language: go
go:
- 1.6.x
- 1.7.x
- 1.8.x
- 1.9.x
- master
matrix:
allow_failures:
- go: master
fast_finish: true
include:
- go: 1.10.x
- go: 1.11.x
env: GOFMT=1
- go: master
install:
- # Do nothing. This is needed to prevent default install action "go get -t -v ./..." from happening here (we want it to happen inside script step).
script:
- go get -t -v ./...
- diff -u <(echo -n) <(gofmt -d .)
- if test -n "${GOFMT}"; then gofmt -w -s . && git diff --exit-code; fi
- go tool vet .
- go test -v -race ./...
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 546c9f7

Please sign in to comment.