diff options
author | feistel <6742251-feistel@users.noreply.gitlab.com> | 2021-09-16 01:26:18 +0300 |
---|---|---|
committer | feistel <6742251-feistel@users.noreply.gitlab.com> | 2022-01-24 15:11:56 +0300 |
commit | ad64a1b4ebf66d20ae18386e0566b8cfa2362565 (patch) | |
tree | 66cac9d45e4328313f6fc491c24387a07cf27d7e /internal | |
parent | 88656e8f55e74ea5d7adf703e36dac23726a139b (diff) |
test: add malformed acme middleware url test
Diffstat (limited to 'internal')
-rw-r--r-- | internal/acme/acme_test.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/internal/acme/acme_test.go b/internal/acme/acme_test.go index 0ee9e6fc..1c3025d9 100644 --- a/internal/acme/acme_test.go +++ b/internal/acme/acme_test.go @@ -39,12 +39,17 @@ var ( domainWithChallenge = &domainStub{hasAcmeChallenge: true} domain = &domainStub{hasAcmeChallenge: false} middleware = &Middleware{GitlabURL: "https://gitlab.example.com"} + middlewareMalformed = &Middleware{GitlabURL: ":foo"} ) func TestServeAcmeChallengesNotConfigured(t *testing.T) { require.HTTPStatusCode(t, serveAcmeOrNotFound(nil, domain), http.MethodGet, challengeURL, nil, http.StatusNotFound) } +func TestServeAcmeChallengeMalformed(t *testing.T) { + require.HTTPStatusCode(t, serveAcmeOrNotFound(middlewareMalformed, domain), http.MethodGet, challengeURL, nil, http.StatusNotFound) +} + func TestServeAcmeChallengeWhenPresent(t *testing.T) { require.HTTPStatusCode(t, serveAcmeOrNotFound(middleware, domainWithChallenge), http.MethodGet, challengeURL, nil, http.StatusNotFound) } |