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 9be4409c..e65d7510 100644
--- a/app.go
+++ b/app.go
@@ -24,6 +24,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"
@@ -51,6 +52,7 @@ type theApp struct {
lock sync.RWMutex
Artifact *artifact.Artifact
Auth *auth.Auth
+ Handlers *handlers.Handlers
AcmeMiddleware *acme.Middleware
CustomHeaders http.Header
}
@@ -145,9 +147,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
}
@@ -488,6 +488,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}
}