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>2021-10-25 03:50:40 +0300
committerVladimir Shushlin <v.shushlin@gmail.com>2021-10-25 12:44:29 +0300
commita05ea2141704d8aeaa21e45365efb9e153e6eb93 (patch)
treea68586b36b8cae8f23270fc1bdbb74a69e8f7131 /app.go
parent1a1adbaf869ed651aae3671c507f726a64b1d7ca (diff)
refactor: remove domain from request
Diffstat (limited to 'app.go')
-rw-r--r--app.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/app.go b/app.go
index eba3c690..cddf8d49 100644
--- a/app.go
+++ b/app.go
@@ -174,8 +174,8 @@ func (a *theApp) healthCheckMiddleware(handler http.Handler) (http.Handler, erro
// not static-content responses
func (a *theApp) auxiliaryMiddleware(handler http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- host := request.GetHost(r)
- domain := request.GetDomain(r)
+ host := domain.GetHost(r)
+ domain := domain.FromRequest(r)
https := request.IsHTTPS(r)
if a.tryAuxiliaryHandlers(w, r, https, host, domain) {
@@ -193,7 +193,7 @@ func (a *theApp) serveFileOrNotFoundHandler() http.Handler {
start := time.Now()
defer metrics.ServingTime.Observe(time.Since(start).Seconds())
- domain := request.GetDomain(r)
+ domain := domain.FromRequest(r)
fileServed := domain.ServeFileHTTP(w, r)
if !fileServed {
@@ -252,7 +252,7 @@ func (a *theApp) buildHandlerPipeline() (http.Handler, error) {
handler = a.auxiliaryMiddleware(handler)
handler = a.Auth.AuthenticationMiddleware(handler, a.source)
handler = a.AcmeMiddleware.AcmeMiddleware(handler)
- handler, err := logging.AccessLogger(handler, a.config.Log.Format)
+ handler, err := logging.BasicAccessLogger(handler, a.config.Log.Format, domain.LogFields)
if err != nil {
return nil, err
}