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

Commit cd554ea

Browse files
committed
Minor correctness/style fixes for test handlers.
1 parent 2f25d93 commit cd554ea

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎httpcache_test.go‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ func setup() {
5656
etag := "124567"
5757
if r.Header.Get("if-none-match") == etag {
5858
w.WriteHeader(http.StatusNotModified)
59+
return
5960
}
6061
w.Header().Set("etag", etag)
6162
}))
@@ -64,6 +65,7 @@ func setup() {
6465
lm := "Fri, 14 Dec 2010 01:01:50 GMT"
6566
if r.Header.Get("if-modified-since") == lm {
6667
w.WriteHeader(http.StatusNotModified)
68+
return
6769
}
6870
w.Header().Set("last-modified", lm)
6971
}))
@@ -102,9 +104,9 @@ func setup() {
102104
updateFieldsCounter++
103105
if r.Header.Get("if-none-match") != "" {
104106
w.WriteHeader(http.StatusNotModified)
105-
} else {
106-
w.Write([]byte("Some text content"))
107+
return
107108
}
109+
w.Write([]byte("Some text content"))
108110
}))
109111
}
110112

0 commit comments

Comments
 (0)