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:
authorJaime Martinez <jmartinez@gitlab.com>2020-11-16 05:56:22 +0300
committerJaime Martinez <jmartinez@gitlab.com>2020-11-30 02:15:09 +0300
commite59ec12bcc06b10860c811bc3810a6320b9855d2 (patch)
tree02e52e3d988ec6cf24415f64b5a73798df2af7a2 /app.go
parent188a44eba522c23110897ac6fb1091a68680db4e (diff)
Move headers to middleware
Diffstat (limited to 'app.go')
-rw-r--r--app.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/app.go b/app.go
index ca495073..a802f96d 100644
--- a/app.go
+++ b/app.go
@@ -21,11 +21,11 @@ import (
"gitlab.com/gitlab-org/gitlab-pages/internal/acme"
"gitlab.com/gitlab-org/gitlab-pages/internal/artifact"
"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/middleware"
"gitlab.com/gitlab-org/gitlab-pages/internal/netutil"
"gitlab.com/gitlab-org/gitlab-pages/internal/request"
"gitlab.com/gitlab-org/gitlab-pages/internal/source"
@@ -186,7 +186,7 @@ func (a *theApp) healthCheckMiddleware(handler http.Handler) (http.Handler, erro
// customHeadersMiddleware will inject custom headers into the response
func (a *theApp) customHeadersMiddleware(handler http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- headerConfig.AddCustomHeaders(w, a.CustomHeaders)
+ middleware.AddCustomHeaders(w, a.CustomHeaders)
handler.ServeHTTP(w, r)
})
@@ -493,7 +493,7 @@ func runApp(config appConfig) {
}
if len(config.CustomHeaders) != 0 {
- customHeaders, err := headerConfig.ParseHeaderString(config.CustomHeaders)
+ customHeaders, err := middleware.ParseHeaderString(config.CustomHeaders)
if err != nil {
log.WithError(err).Fatal("Unable to parse header string")
}