Skip to content

Commit

Permalink
Tidy up a test
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinmcconnell committed Jan 7, 2025
1 parent 202f50a commit 545d52c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/server/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func TestService_ServeRequest(t *testing.T) {
require.Equal(t, http.StatusOK, w.Result().StatusCode)
}

func TestService_RedirectToHTTPWhenTLSRequired(t *testing.T) {
func TestService_RedirectToHTTPSWhenTLSRequired(t *testing.T) {
service := testCreateService(t, []string{"example.com"}, ServiceOptions{TLSEnabled: true}, defaultTargetOptions)

require.True(t, service.options.TLSEnabled)
Expand All @@ -34,6 +34,7 @@ func TestService_RedirectToHTTPWhenTLSRequired(t *testing.T) {
service.ServeHTTP(w, req)

require.Equal(t, http.StatusMovedPermanently, w.Result().StatusCode)
require.Equal(t, "https://example.com/", w.Result().Header.Get("Location"))

req = httptest.NewRequest(http.MethodGet, "https://example.com", nil)
w = httptest.NewRecorder()
Expand Down

0 comments on commit 545d52c

Please sign in to comment.