Skip to content

Commit

Permalink
Remove Content-Type test from TestGzipHandler
Browse files Browse the repository at this point in the history
This functionality is already tested in TestInferContentType which is
more obvious and correct.
  • Loading branch information
tmthrgd committed Dec 4, 2017
1 parent 317d44d commit 8bc6fda
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions gzip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,6 @@ func TestGzipHandler(t *testing.T) {
assert.Equal(t, "gzip", res2.Header.Get("Content-Encoding"))
assert.Equal(t, "Accept-Encoding", res2.Header.Get("Vary"))
assert.Equal(t, gzipStrLevel(testBody, DefaultCompression), resp2.Body.Bytes())

// content-type header is correctly set based on uncompressed body

req3 := httptest.NewRequest(http.MethodGet, "/whatever", nil)
req3.Header.Set("Accept-Encoding", "gzip")
res3 := httptest.NewRecorder()
handler.ServeHTTP(res3, req3)

assert.Equal(t, http.DetectContentType([]byte(testBody)), res3.Header().Get("Content-Type"))
}

func TestGzipLevelHandler(t *testing.T) {
Expand Down

0 comments on commit 8bc6fda

Please sign in to comment.