Send 'Retry-After' to comply with RFC6585.
This commit is contained in:
parent
027093a5a5
commit
8d75aba7eb
29 changed files with 435 additions and 172 deletions
7
vendor/github.com/vulcand/oxy/utils/handler.go
generated
vendored
7
vendor/github.com/vulcand/oxy/utils/handler.go
generated
vendored
|
@ -8,14 +8,16 @@ import (
|
|||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// ErrorHandler error handler
|
||||
type ErrorHandler interface {
|
||||
ServeHTTP(w http.ResponseWriter, req *http.Request, err error)
|
||||
}
|
||||
|
||||
// DefaultHandler default error handler
|
||||
var DefaultHandler ErrorHandler = &StdHandler{}
|
||||
|
||||
type StdHandler struct {
|
||||
}
|
||||
// StdHandler Standard error handler
|
||||
type StdHandler struct{}
|
||||
|
||||
func (e *StdHandler) ServeHTTP(w http.ResponseWriter, req *http.Request, err error) {
|
||||
statusCode := http.StatusInternalServerError
|
||||
|
@ -33,6 +35,7 @@ func (e *StdHandler) ServeHTTP(w http.ResponseWriter, req *http.Request, err err
|
|||
log.Debugf("'%d %s' caused by: %v", statusCode, http.StatusText(statusCode), err)
|
||||
}
|
||||
|
||||
// ErrorHandlerFunc error handler function type
|
||||
type ErrorHandlerFunc func(http.ResponseWriter, *http.Request, error)
|
||||
|
||||
// ServeHTTP calls f(w, r).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue