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:
authorKassio Borges <kborges@gitlab.com>2023-04-04 12:32:18 +0300
committerVladimir Shushlin <vshushlin@gitlab.com>2023-04-04 12:32:18 +0300
commit7946cb0dc92ac6a306b55af1ec3c17dc936d742c (patch)
tree006e691eb52cb4e33987e11e80026ae17646ebd9 /app.go
parent7817434f90966c6cd5dbee8fd1894c039eddc8af (diff)
Redirect to unique domain
Diffstat (limited to 'app.go')
-rw-r--r--app.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/app.go b/app.go
index f35df26c..96aa084b 100644
--- a/app.go
+++ b/app.go
@@ -40,6 +40,7 @@ import (
"gitlab.com/gitlab-org/gitlab-pages/internal/source"
"gitlab.com/gitlab-org/gitlab-pages/internal/source/gitlab"
"gitlab.com/gitlab-org/gitlab-pages/internal/tls"
+ "gitlab.com/gitlab-org/gitlab-pages/internal/uniqueDomain"
"gitlab.com/gitlab-org/gitlab-pages/internal/urilimiter"
"gitlab.com/gitlab-org/gitlab-pages/metrics"
)
@@ -133,6 +134,7 @@ func setRequestScheme(r *http.Request) *http.Request {
func (a *theApp) buildHandlerPipeline() (http.Handler, error) {
// Handlers should be applied in a reverse order
handler := a.serveFileOrNotFoundHandler()
+ handler = uniqueDomain.NewMiddleware(handler)
handler = a.Auth.AuthorizationMiddleware(handler)
handler = routing.NewMiddleware(handler, a.source)