fix for url query params in url

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2021-09-01 02:25:29 +03:00
parent a1f432fac9
commit 807b4dc41a

View File

@ -88,7 +88,13 @@ func newRequest(ctx context.Context, addr string, req client.Request, ct string,
return nil, errors.BadRequest("go.micro.client", err.Error()) return nil, errors.BadRequest("go.micro.client", err.Error())
} }
path, nmsg, err := newPathRequest(u.Path, method, body, msg, tags) var nmsg interface{}
if len(u.Query()) > 0 {
path, nmsg, err = newPathRequest(u.Path+"?"+u.Query().Encode(), method, body, msg, tags)
} else {
path, nmsg, err = newPathRequest(u.Path, method, body, msg, tags)
}
if err != nil { if err != nil {
return nil, errors.BadRequest("go.micro.client", err.Error()) return nil, errors.BadRequest("go.micro.client", err.Error())
} }