diff options
author | Vladimir Shushlin <vshushlin@gitlab.com> | 2022-04-26 11:57:28 +0300 |
---|---|---|
committer | Vladimir Shushlin <vshushlin@gitlab.com> | 2022-04-26 11:57:28 +0300 |
commit | b136cc6f86655324ad2216a8a94ad519817b3641 (patch) | |
tree | 6f88c266cf15ce0a3e94b26f516ba156bdca1f96 | |
parent | c4b5a74dcade0612f6025fb548169ece6d55a7ae (diff) | |
parent | 0ee4835dc24c65acd51b85d7f668089a2d4de78c (diff) |
Merge branch 'fix/acme-middleware' into 'master'
fix acme middleware passing handled requests to parent middlewares
See merge request gitlab-org/gitlab-pages!736
-rw-r--r-- | internal/acme/acme.go | 2 | ||||
-rw-r--r-- | internal/acme/acme_test.go | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/internal/acme/acme.go b/internal/acme/acme.go index 039be32a..7b086eeb 100644 --- a/internal/acme/acme.go +++ b/internal/acme/acme.go @@ -31,7 +31,7 @@ func (m *Middleware) ServeAcmeChallenges(w http.ResponseWriter, r *http.Request, } if domain.ServeFileHTTP(w, r) { - return false + return true } return m.redirectToGitlab(w, r) diff --git a/internal/acme/acme_test.go b/internal/acme/acme_test.go index 1c3025d9..225d1dc4 100644 --- a/internal/acme/acme_test.go +++ b/internal/acme/acme_test.go @@ -51,7 +51,7 @@ func TestServeAcmeChallengeMalformed(t *testing.T) { } func TestServeAcmeChallengeWhenPresent(t *testing.T) { - require.HTTPStatusCode(t, serveAcmeOrNotFound(middleware, domainWithChallenge), http.MethodGet, challengeURL, nil, http.StatusNotFound) + require.HTTPStatusCode(t, serveAcmeOrNotFound(middleware, domainWithChallenge), http.MethodGet, challengeURL, nil, http.StatusOK) } func TestServeAcmeChallengeWhenMissing(t *testing.T) { |