Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSONRPC client does not set Content-Length header #1020

Closed
ryan-lang opened this issue Oct 9, 2020 · 0 comments
Closed

JSONRPC client does not set Content-Length header #1020

ryan-lang opened this issue Oct 9, 2020 · 0 comments

Comments

@ryan-lang
Copy link
Contributor

A fix similar to #796 is needed for the JSONRPC client, as it does not set the Content-Length header by default, which can cause issues decoding the content at the server. In my case, it's not even a 3rd party service - it's another go-kit JSONRPC service behind a load balancer.

I see three possible solutions:

  1. something similar to transport/http: NewExplicitClient #971
  2. set content-length by default. This could be accomplished with a single line: req.ContentLength = int64(b.Len()) immediately after the json is loaded into the request body
  3. set content-length by hand in a before RequestFunc

Please advise on the preferred path, and if it's solution 1 or 2, I'd be happy to offer a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants