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:
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}
}