fixup old rpc http server

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2022-01-30 20:43:27 +03:00
parent fed13e1293
commit e9a396d424
2 changed files with 23 additions and 2 deletions

View File

@@ -221,8 +221,9 @@ func (h *httpServer) NewHandler(handler interface{}, opts ...server.HandlerOptio
}
if h.registerRPC {
h.opts.Logger.Infof(h.opts.Context, "register rpc handler for http.MethodPost %s /%s", hn, hn)
if err := hdlr.handlers.Insert([]string{http.MethodPost}, "/"+hn, pth); err != nil {
h.opts.Logger.Errorf(h.opts.Context, "cant add handler for %s %s", md["Method"], md["Path"])
h.opts.Logger.Errorf(h.opts.Context, "cant add rpc handler for http.MethodPost %s /%s", hn, hn)
}
}
}