mirror of
https://github.com/pomerium/pomerium.git
synced 2025-06-24 21:48:23 +02:00
httputil : wrap handlers for additional context (#413)
Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
This commit is contained in:
parent
487fc655d6
commit
b3d3159185
27 changed files with 495 additions and 463 deletions
|
@ -176,8 +176,8 @@ func (p *Proxy) UpdatePolicies(opts *config.Options) error {
|
|||
log.Warn().Msg("proxy: configuration has no policies")
|
||||
}
|
||||
r := httputil.NewRouter()
|
||||
r.NotFoundHandler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
httputil.ErrorResponse(w, r, httputil.Error(fmt.Sprintf("%s route unknown", r.Host), http.StatusNotFound, nil))
|
||||
r.NotFoundHandler = httputil.HandlerFunc(func(w http.ResponseWriter, r *http.Request) error {
|
||||
return httputil.NewError(http.StatusNotFound, fmt.Errorf("%s route unknown", r.Host))
|
||||
})
|
||||
r.SkipClean(true)
|
||||
r.StrictSlash(true)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue