From 333b7850618707e8a61e322f265fe39897a86c9a Mon Sep 17 00:00:00 2001 From: SALLEYRON Julien Date: Sat, 7 Jul 2018 10:14:03 +0200 Subject: [PATCH] Add logs when error is generated in error handler --- Gopkg.lock | 5 ++--- vendor/github.com/vulcand/oxy/forward/rewrite.go | 4 ++++ vendor/github.com/vulcand/oxy/utils/handler.go | 3 +++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index ef2fc31bd..62fe7fc3f 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -764,7 +764,6 @@ version = "v1.3.7" [[projects]] - branch = "master" name = "github.com/jjcollinge/servicefabric" packages = ["."] revision = "8eebe170fa1ba25d3dfb928b3f86a7313b13b9fe" @@ -1250,7 +1249,7 @@ "roundrobin", "utils" ] - revision = "c2414f4542f085363f490048da2fbec5e4537eb6" + revision = "adbef6bedf021985587c3c18c9d4b84b2d78f67c" [[projects]] name = "github.com/vulcand/predicate" @@ -1739,6 +1738,6 @@ [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "53d03fd81596d9560d751bc1102615990a91b0779cff079784a9a1c6641bd503" + inputs-digest = "a3429eccf578f09c7c521a32f81df1af5f0a24cb8c9702b7b768f3db34153216" solver-name = "gps-cdcl" solver-version = 1 diff --git a/vendor/github.com/vulcand/oxy/forward/rewrite.go b/vendor/github.com/vulcand/oxy/forward/rewrite.go index 38a7f7fc4..6ec78987b 100644 --- a/vendor/github.com/vulcand/oxy/forward/rewrite.go +++ b/vendor/github.com/vulcand/oxy/forward/rewrite.go @@ -85,6 +85,10 @@ func forwardedPort(req *http.Request) string { return port } + if req.Header.Get(XForwardedProto) == "https" || req.Header.Get(XForwardedProto) == "wss" { + return "443" + } + if req.TLS != nil { return "443" } diff --git a/vendor/github.com/vulcand/oxy/utils/handler.go b/vendor/github.com/vulcand/oxy/utils/handler.go index 003fc0319..f385a6888 100644 --- a/vendor/github.com/vulcand/oxy/utils/handler.go +++ b/vendor/github.com/vulcand/oxy/utils/handler.go @@ -4,6 +4,8 @@ import ( "io" "net" "net/http" + + log "github.com/sirupsen/logrus" ) type ErrorHandler interface { @@ -28,6 +30,7 @@ func (e *StdHandler) ServeHTTP(w http.ResponseWriter, req *http.Request, err err } w.WriteHeader(statusCode) w.Write([]byte(http.StatusText(statusCode))) + log.Debugf("'%d %s' caused by: %v", statusCode, http.StatusText(statusCode), err) } type ErrorHandlerFunc func(http.ResponseWriter, *http.Request, error)