diff options
author | Filip Aleksic <faleksic@gitlab.com> | 2022-07-26 10:53:41 +0300 |
---|---|---|
committer | Jaime Martinez <jmartinez@gitlab.com> | 2022-07-26 10:53:41 +0300 |
commit | a131f2bdf10e2815d79e3581fe6536b1499839b6 (patch) | |
tree | 723189f5398744b7e5a0e260835a0c38f84f2f66 /internal/acme | |
parent | 0674de2e8e74a35bec70380b02da63dd7db1b8bb (diff) |
Fixes acme redirection issues when using a wildcard redirect
Changelog: fixed
Diffstat (limited to 'internal/acme')
-rw-r--r-- | internal/acme/acme.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/acme/acme.go b/internal/acme/acme.go index c83fcc08..ae808cdd 100644 --- a/internal/acme/acme.go +++ b/internal/acme/acme.go @@ -15,7 +15,7 @@ type FallbackStrategy func(http.ResponseWriter, *http.Request) bool // ServeAcmeChallenges identifies if request is acme-challenge and redirects to GitLab in that case func ServeAcmeChallenges(w http.ResponseWriter, r *http.Request, fallback FallbackStrategy, gitlabURL *url.URL) bool { - if !isAcmeChallenge(r.URL.Path) { + if !IsAcmeChallenge(r.URL.Path) { return false } @@ -27,7 +27,7 @@ func ServeAcmeChallenges(w http.ResponseWriter, r *http.Request, fallback Fallba return true } -func isAcmeChallenge(path string) bool { +func IsAcmeChallenge(path string) bool { return strings.HasPrefix(filepath.Clean(path), "/.well-known/acme-challenge/") } |