You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// NewRequestParser creates a new request parser from the given http.Request and resolver.funcNewRequestParser(r*http.Request, resolver jsonpb.AnyResolver) (grpcurl.RequestParser, error) {
vars:=pathvar.Vars(r)
params, err:=httpx.GetFormValues(r)
iferr!=nil {
returnnil, err
}
fork, v:=rangevars {
params[k] =v
}
body, ok:=getBody(r)
if!ok {
returnbuildJsonRequestParser(params, resolver)
}
iflen(params) ==0 {
returngrpcurl.NewJSONRequestParser(body, resolver), nil
}
m:=make(map[string]any)
iferr:=json.NewDecoder(body).Decode(&m); err!=nil {
// here return io.EOF// Because the body's data has already been read by the above call to function GetFormValues?// Even though there's an error, but params maybe have data!returnnil, err
}
fork, v:=rangeparams {
m[k] =v
}
returnbuildJsonRequestParser(m, resolver)
}
Gateway configuration parameters:
Test with postman:
Cause of the problem
My solution
End
If my changes are accepted, I can initiate a pr, or do you have a better way?
The text was updated successfully, but these errors were encountered: