diff options
Diffstat (limited to 'pkg/api/server/server.go')
-rw-r--r-- | pkg/api/server/server.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/pkg/api/server/server.go b/pkg/api/server/server.go index d39528f45..499a4c58a 100644 --- a/pkg/api/server/server.go +++ b/pkg/api/server/server.go @@ -92,8 +92,17 @@ func newServer(runtime *libpod.Runtime, duration time.Duration, listener *net.Li }, ) + router.MethodNotAllowedHandler = http.HandlerFunc( + func(w http.ResponseWriter, r *http.Request) { + // We can track user errors... + logrus.Infof("Failed Request: (%d:%s) for %s:'%s'", http.StatusMethodNotAllowed, http.StatusText(http.StatusMethodNotAllowed), r.Method, r.URL.String()) + http.Error(w, http.StatusText(http.StatusMethodNotAllowed), http.StatusMethodNotAllowed) + }, + ) + for _, fn := range []func(*mux.Router) error{ server.registerAuthHandlers, + server.registerAchiveHandlers, server.registerContainersHandlers, server.registerDistributionHandlers, server.registerEventsHandlers, |