From a7241ac48feebf5b15878f8e5f695c96e265de9c Mon Sep 17 00:00:00 2001 From: Irioth Date: Fri, 16 Feb 2018 18:22:12 +0300 Subject: [PATCH] fix issue with incorect handling missing paths Due to creation of new router in func registerPaths, we losing NotFoundHandler. And proxy incorrectly disallow such API with 404. This pull request intended to fix that. --- proxy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy.go b/proxy.go index 2bc75bf..d5173d4 100644 --- a/proxy.go +++ b/proxy.go @@ -58,8 +58,8 @@ func New(s *spec.Swagger, reporter Reporter, opts ...ProxyOpt) (*Proxy, error) { } proxy.reverseProxy = httputil.NewSingleHostReverseProxy(rpURL) - proxy.router.NotFoundHandler = http.HandlerFunc(proxy.notFound) proxy.registerPaths() + proxy.router.NotFoundHandler = http.HandlerFunc(proxy.notFound) return proxy, nil }