diff options
author | Jaime Martinez <jmartinez@gitlab.com> | 2022-06-28 07:13:09 +0300 |
---|---|---|
committer | Jaime Martinez <jmartinez@gitlab.com> | 2022-06-28 07:13:09 +0300 |
commit | 7fd2e59052a24e8b2a78e4af87f292b3d8c1f8b3 (patch) | |
tree | 7636ca0628a698d8fa6eaace788aca3e866f4a8f /test | |
parent | 1737c75532848a74018fe62f817ceab074271bdd (diff) | |
parent | 3e8a817dd5aa36457fb611967d951fe1545e9593 (diff) |
Merge branch 'fix/test-acme-sigsev' into 'master'
test: check for errors in acme tests before passing the body
See merge request gitlab-org/gitlab-pages!797
Diffstat (limited to 'test')
-rw-r--r-- | test/acceptance/acme_test.go | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/test/acceptance/acme_test.go b/test/acceptance/acme_test.go index d743a4e1..40d98a21 100644 --- a/test/acceptance/acme_test.go +++ b/test/acceptance/acme_test.go @@ -7,8 +7,6 @@ import ( "testing" "github.com/stretchr/testify/require" - - "gitlab.com/gitlab-org/gitlab-pages/internal/testhelpers" ) const ( @@ -43,10 +41,10 @@ func TestAcmeChallengesWhenItIsNotConfigured(t *testing.T) { rsp, err := GetRedirectPage(t, httpListener, "withacmechallenge.domain.com", test.token) - testhelpers.Close(t, rsp.Body) require.NoError(t, err) require.Equal(t, test.expectedStatus, rsp.StatusCode) body, err := io.ReadAll(rsp.Body) + require.NoError(t, rsp.Body.Close()) require.NoError(t, err) require.Contains(t, string(body), test.expectedContent) @@ -84,10 +82,10 @@ func TestAcmeChallengesWhenItIsConfigured(t *testing.T) { rsp, err := GetRedirectPage(t, httpListener, "withacmechallenge.domain.com", test.token) - testhelpers.Close(t, rsp.Body) require.NoError(t, err) require.Equal(t, test.expectedStatus, rsp.StatusCode) body, err := io.ReadAll(rsp.Body) + require.NoError(t, rsp.Body.Close()) require.NoError(t, err) require.Contains(t, string(body), test.expectedContent) |