Add logs when error is generated in error handler
This commit is contained in:
parent
79bf19c897
commit
333b785061
3 changed files with 9 additions and 3 deletions
5
Gopkg.lock
generated
5
Gopkg.lock
generated
|
@ -764,7 +764,6 @@
|
||||||
version = "v1.3.7"
|
version = "v1.3.7"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
|
||||||
name = "github.com/jjcollinge/servicefabric"
|
name = "github.com/jjcollinge/servicefabric"
|
||||||
packages = ["."]
|
packages = ["."]
|
||||||
revision = "8eebe170fa1ba25d3dfb928b3f86a7313b13b9fe"
|
revision = "8eebe170fa1ba25d3dfb928b3f86a7313b13b9fe"
|
||||||
|
@ -1250,7 +1249,7 @@
|
||||||
"roundrobin",
|
"roundrobin",
|
||||||
"utils"
|
"utils"
|
||||||
]
|
]
|
||||||
revision = "c2414f4542f085363f490048da2fbec5e4537eb6"
|
revision = "adbef6bedf021985587c3c18c9d4b84b2d78f67c"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
name = "github.com/vulcand/predicate"
|
name = "github.com/vulcand/predicate"
|
||||||
|
@ -1739,6 +1738,6 @@
|
||||||
[solve-meta]
|
[solve-meta]
|
||||||
analyzer-name = "dep"
|
analyzer-name = "dep"
|
||||||
analyzer-version = 1
|
analyzer-version = 1
|
||||||
inputs-digest = "53d03fd81596d9560d751bc1102615990a91b0779cff079784a9a1c6641bd503"
|
inputs-digest = "a3429eccf578f09c7c521a32f81df1af5f0a24cb8c9702b7b768f3db34153216"
|
||||||
solver-name = "gps-cdcl"
|
solver-name = "gps-cdcl"
|
||||||
solver-version = 1
|
solver-version = 1
|
||||||
|
|
4
vendor/github.com/vulcand/oxy/forward/rewrite.go
generated
vendored
4
vendor/github.com/vulcand/oxy/forward/rewrite.go
generated
vendored
|
@ -85,6 +85,10 @@ func forwardedPort(req *http.Request) string {
|
||||||
return port
|
return port
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if req.Header.Get(XForwardedProto) == "https" || req.Header.Get(XForwardedProto) == "wss" {
|
||||||
|
return "443"
|
||||||
|
}
|
||||||
|
|
||||||
if req.TLS != nil {
|
if req.TLS != nil {
|
||||||
return "443"
|
return "443"
|
||||||
}
|
}
|
||||||
|
|
3
vendor/github.com/vulcand/oxy/utils/handler.go
generated
vendored
3
vendor/github.com/vulcand/oxy/utils/handler.go
generated
vendored
|
@ -4,6 +4,8 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
|
log "github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ErrorHandler interface {
|
type ErrorHandler interface {
|
||||||
|
@ -28,6 +30,7 @@ func (e *StdHandler) ServeHTTP(w http.ResponseWriter, req *http.Request, err err
|
||||||
}
|
}
|
||||||
w.WriteHeader(statusCode)
|
w.WriteHeader(statusCode)
|
||||||
w.Write([]byte(http.StatusText(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)
|
type ErrorHandlerFunc func(http.ResponseWriter, *http.Request, error)
|
||||||
|
|
Loading…
Reference in a new issue