Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2019-10-01 12:53:16 +0300
committerKamil Trzciński <ayufan@ayufan.eu>2019-10-01 12:53:16 +0300
commitb37ed1c0ff9880fb73ed2ed771c100333d79f3c5 (patch)
treee7e60fab0101acbda400e9cd98cf843cecc49236 /internal/acme/acme_test.go
parent9660a822ed42dd28fa1d7e878a1a7f05c2b351b5 (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_test.go')
-rw-r--r--internal/acme/acme_test.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/internal/acme/acme_test.go b/internal/acme/acme_test.go
index 00932d3e..ab191694 100644
--- a/internal/acme/acme_test.go
+++ b/internal/acme/acme_test.go
@@ -11,8 +11,12 @@ type domainStub struct {
hasAcmeChallenge bool
}
-func (d *domainStub) HasAcmeChallenge(_ *http.Request, _ string) bool {
- return d.hasAcmeChallenge
+func (d *domainStub) ServeFileHTTP(w http.ResponseWriter, r *http.Request) bool {
+ if r.URL.Path == "/.well-known/acme-challenge/token" {
+ return d.hasAcmeChallenge
+ }
+
+ return false
}
func serveAcmeOrNotFound(m *Middleware, domain Domain) http.HandlerFunc {