From 09caac9a802517e5590da83436b10f88ab17e0ca Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Sat, 11 Apr 2020 22:21:55 +0300 Subject: [PATCH] api minor improvements (#1526) * api/handler/rpc: unblock all http methods and set Host meta * api/router/static: add debug log Signed-off-by: Vasiliy Tolstov --- static.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/static.go b/static.go index f868e52..0c659c3 100644 --- a/static.go +++ b/static.go @@ -264,7 +264,9 @@ func (r *staticRouter) endpoint(req *http.Request) (*endpoint, error) { for _, pathreg := range ep.pathregs { matches, err := pathreg.Match(path, "") if err != nil { - // TODO: log error + if logger.V(logger.DebugLevel, logger.DefaultLogger) { + logger.Debugf("api path not match %s != %v", path, pathreg) + } continue } pMatch = true @@ -290,7 +292,7 @@ func (r *staticRouter) endpoint(req *http.Request) (*endpoint, error) { } // no match - return nil, fmt.Errorf("endpoint not found for %v", req) + return nil, fmt.Errorf("endpoint not found for %v", req.URL) } func (r *staticRouter) Route(req *http.Request) (*api.Service, error) {