mirror of
https://github.com/pomerium/pomerium.git
synced 2025-06-02 10:52:49 +02:00
proxy: use custom 404 handler (#348)
Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
This commit is contained in:
parent
eaa1e7a4fb
commit
7016534d87
1 changed files with 3 additions and 0 deletions
|
@ -168,6 +168,9 @@ 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.SkipClean(true)
|
||||
r.StrictSlash(true)
|
||||
r.HandleFunc("/robots.txt", p.RobotsTxt).Methods(http.MethodGet)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue