fix query param struct filling #167

Merged
vtolstov merged 1 commits from matchesfix into v3 2023-05-29 12:27:17 +03:00
1 changed files with 6 additions and 4 deletions

View File

@ -487,10 +487,12 @@ func (h *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}
}
matches = rflutil.FlattenMap(matches)
if err = rflutil.Merge(argv.Interface(), matches, rflutil.SliceAppend(true), rflutil.Tags([]string{"protobuf", "json"})); err != nil {
h.errorHandler(ctx, handler, w, r, err, http.StatusBadRequest)
return
if len(matches) > 0 {
matches = rflutil.FlattenMap(matches)
if err = rflutil.Merge(argv.Interface(), matches, rflutil.SliceAppend(true), rflutil.Tags([]string{"protobuf", "json"})); err != nil {
h.errorHandler(ctx, handler, w, r, err, http.StatusBadRequest)
return
}
}
hr := &rpcRequest{