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-07-07 05:19:48 +0300
committerJaime Martinez <jmartinez@gitlab.com>2021-07-07 05:19:48 +0300
commit86afc1dfeeb07fbc140d08ef8cdcfd8cbd4d7bcb (patch)
tree41a2d15d113a8dba2513ca42d9c82722d1c5892b /app.go
parente74c91bfe5c95d6da82691e0c753cc50b661613c (diff)
Improve logging and correlation ID
Diffstat (limited to 'app.go')
-rw-r--r--app.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/app.go b/app.go
index 05203478..8f17e535 100644
--- a/app.go
+++ b/app.go
@@ -12,7 +12,7 @@ import (
ghandlers "github.com/gorilla/handlers"
"github.com/rs/cors"
- log "github.com/sirupsen/logrus"
+ "gitlab.com/gitlab-org/labkit/log"
"gitlab.com/gitlab-org/go-mimedb"
"gitlab.com/gitlab-org/labkit/correlation"
@@ -346,11 +346,17 @@ func (a *theApp) buildHandlerPipeline() (http.Handler, error) {
// Custom response headers
handler = a.customHeadersMiddleware(handler)
+ //handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ // fmt.Printf("the req headers: %+v\n", r.Header)
+ // fmt.Printf("the correlationID must have been here: %q\n", correlation.ExtractFromContext(r.Context()))
+ // handler.ServeHTTP(w, r)
+ // return
+ //})
// Correlation ID injection middleware
var correlationOpts []correlation.InboundHandlerOption
if a.config.General.PropagateCorrelationID {
- correlationOpts = append(correlationOpts, correlation.WithPropagation())
+ correlationOpts = append(correlationOpts, correlation.WithPropagation(), correlation.WithSetResponseHeader())
}
handler = correlation.InjectCorrelationID(handler, correlationOpts...)