Skip to content

JSONRPC client does not set Content-Length header #1020

Closed
@ryan-lang

Description

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions