diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2019-10-02 16:00:22 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2019-10-02 16:00:22 +0300 |
commit | 9ecd5703d7c0325c01c65c51a9ec625b1436a1ad (patch) | |
tree | 6c91b45200631720338466a49a05f849feddfc3a /app.go | |
parent | 78c7e7be19993403054f8584fbc5b6c17885b20f (diff) | |
parent | 9943255d61c5646f6cf9e1a8a03e4a2dc19831f5 (diff) |
Merge branch 'master' into backstage/gb/domain-serving-refactoring
Diffstat (limited to 'app.go')
-rw-r--r-- | app.go | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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} } |