Skip to content

Commit

Permalink
refactor: exclude healthcheck from access logs
Browse files Browse the repository at this point in the history
  • Loading branch information
cshum committed Mar 7, 2024
1 parent d8a58fe commit 572ff08
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,17 @@ func TestServer(t *testing.T) {
)

w := httptest.NewRecorder()
s.Handler.ServeHTTP(w, httptest.NewRequest(http.MethodGet, "https://example.com/favicon.ico", nil))
s.Handler.ServeHTTP(w, httptest.NewRequest(http.MethodGet, "https://example.com/", nil))
assert.Equal(t, 200, w.Code)
assert.NotEmpty(t, w.Header().Get("Vary"))
assert.Equal(t, "Bar", w.Header().Get("X-Foo"))

w = httptest.NewRecorder()
s.Handler.ServeHTTP(w, httptest.NewRequest(http.MethodPost, "https://example.com/favicon.ico", nil))
s.Handler.ServeHTTP(w, httptest.NewRequest(http.MethodPost, "https://example.com/", nil))
assert.Equal(t, 405, w.Code)

w = httptest.NewRecorder()
s.Handler.ServeHTTP(w, httptest.NewRequest(http.MethodGet, "https://example.com/healthcheck", nil))
s.Handler.ServeHTTP(w, httptest.NewRequest(http.MethodGet, "https://example.com/", nil))
assert.Equal(t, 200, w.Code)
assert.NotEmpty(t, w.Header().Get("Vary"))
assert.Equal(t, "Bar", w.Header().Get("X-Foo"))
Expand Down

0 comments on commit 572ff08

Please sign in to comment.