mirror of
https://github.com/rclone/rclone.git
synced 2024-11-25 09:41:44 +08:00
lib/http: add default 404 handler
This commit is contained in:
parent
35a86193b7
commit
e489a101f6
|
@ -173,6 +173,9 @@ func NewServer(listeners, tlsListeners []net.Listener, opt Options) (Server, err
|
|||
router.MethodNotAllowed(func(w http.ResponseWriter, _ *http.Request) {
|
||||
http.Error(w, http.StatusText(http.StatusMethodNotAllowed), http.StatusMethodNotAllowed)
|
||||
})
|
||||
router.NotFound(func(w http.ResponseWriter, _ *http.Request) {
|
||||
http.Error(w, http.StatusText(http.StatusNotFound), http.StatusNotFound)
|
||||
})
|
||||
|
||||
handler := router.(http.Handler)
|
||||
if opt.BaseURL != "" {
|
||||
|
|
Loading…
Reference in New Issue
Block a user