diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2019-10-01 12:53:16 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2019-10-01 12:53:16 +0300 |
commit | b37ed1c0ff9880fb73ed2ed771c100333d79f3c5 (patch) | |
tree | e7e60fab0101acbda400e9cd98cf843cecc49236 /internal/acme/acme.go | |
parent | 9660a822ed42dd28fa1d7e878a1a7f05c2b351b5 (diff) |
Refactor the code to use `Serving/LookupPath`
This moves the code from the concept
of `Project` to use a concept of `LookupPath`.
This makes the `LookupPath` to define a `Path` on disk that
the data is being served from.
This makes the `ACME` to not have special
handling, but rather try to serve the file
if succeeds, skip GitLab passthrough
for ACME.
Diffstat (limited to 'internal/acme/acme.go')
-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 a6be01de..3bfa8f2e 100644 --- a/internal/acme/acme.go +++ b/internal/acme/acme.go @@ -18,7 +18,7 @@ type Middleware struct { // Domain interface represent D from domain package type Domain interface { - HasAcmeChallenge(*http.Request, string) bool + ServeFileHTTP(w http.ResponseWriter, r *http.Request) bool } // ServeAcmeChallenges identifies if request is acme-challenge and redirects to GitLab in that case @@ -31,7 +31,7 @@ func (m *Middleware) ServeAcmeChallenges(w http.ResponseWriter, r *http.Request, return false } - if domain.HasAcmeChallenge(r, filepath.Base(r.URL.Path)) { + if domain.ServeFileHTTP(w, r) { return false } |