server: remove unparsed body from request and message #105

Merged
vtolstov merged 3 commits from cleanup into v3 2022-03-21 15:43:43 +03:00
1 changed files with 9 additions and 6 deletions
Showing only changes of commit 1cc8b37503 - Show all commits

15
http.go
View File

@ -184,14 +184,17 @@ func (h *httpServer) NewHandler(handler interface{}, opts ...server.HandlerOptio
tp := reflect.TypeOf(handler)
if len(options.Metadata) == 0 {
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 rpc handler for http.MethodPost %s /%s", hn, hn)
/*
if len(options.Metadata) == 0 {
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 rpc handler for http.MethodPost %s /%s", hn, hn)
}
}
}
}
*/
for hn, md := range options.Metadata {
var method reflect.Method
mname := hn[strings.Index(hn, ".")+1:]