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
path: root/app.go
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2019-10-02 16:00:22 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2019-10-02 16:00:22 +0300
commit9ecd5703d7c0325c01c65c51a9ec625b1436a1ad (patch)
tree6c91b45200631720338466a49a05f849feddfc3a /app.go
parent78c7e7be19993403054f8584fbc5b6c17885b20f (diff)
parent9943255d61c5646f6cf9e1a8a03e4a2dc19831f5 (diff)
Merge branch 'master' into backstage/gb/domain-serving-refactoring
Diffstat (limited to 'app.go')
-rw-r--r--app.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/app.go b/app.go
index 82cc2680..e9130467 100644
--- a/app.go
+++ b/app.go
@@ -22,6 +22,7 @@ import (
"gitlab.com/gitlab-org/gitlab-pages/internal/auth"
headerConfig "gitlab.com/gitlab-org/gitlab-pages/internal/config"
"gitlab.com/gitlab-org/gitlab-pages/internal/domain"
+ "gitlab.com/gitlab-org/gitlab-pages/internal/handlers"
"gitlab.com/gitlab-org/gitlab-pages/internal/httperrors"
"gitlab.com/gitlab-org/gitlab-pages/internal/logging"
"gitlab.com/gitlab-org/gitlab-pages/internal/netutil"
@@ -49,6 +50,7 @@ type theApp struct {
domains *source.Domains
Artifact *artifact.Artifact
Auth *auth.Auth
+ Handlers *handlers.Handlers
AcmeMiddleware *acme.Middleware
CustomHeaders http.Header
}
@@ -139,9 +141,7 @@ func (a *theApp) tryAuxiliaryHandlers(w http.ResponseWriter, r *http.Request, ht
return true
}
- // In the event a host is prefixed with the artifact prefix an artifact
- // value is created, and an attempt to proxy the request is made
- if a.Artifact.TryMakeRequest(host, w, r) {
+ if a.Handlers.HandleArtifactRequest(host, w, r) {
return true
}
@@ -477,6 +477,8 @@ func runApp(config appConfig) {
config.RedirectURI, config.GitLabServer)
}
+ a.Handlers = handlers.New(a.Auth, a.Artifact)
+
if config.GitLabServer != "" {
a.AcmeMiddleware = &acme.Middleware{GitlabURL: config.GitLabServer}
}