Have full control over the User-Agent
Feature Request
Motivation
The User-Agent header is populated, by default, with tonic/x.y.z (x.y.z. being the current tonic version number)
There is a user_agent method to somehow customize this by adding a prefix to this tonic/x.y.z part.
Proposal
In some use cases, users could want to totally customize the user-agent. Not suffixing with tonic/x.y.z would probably be a good idea.
I'm not sure why this suffix has been made compulsory anyway (but maybe I'm missing something? Is this required by some spec? I feel that any server requiring to know the client version is probably poorly designed)
Thanks
The endpoint code will be going away in future releases, so I am adverse to making changes like this right now. That said, you can always wrap your Client in a tower service and use https://docs.rs/tower-http/latest/tower_http/trait.ServiceBuilderExt.html#tymethod.override_request_header to set the user agent header with what you 'd like.
@LucioFranco isnt tonic transport lower level than tower middleware? wont tonic just override the tower value?
I just confirmed that behaviour with a test. the tonic transport overrides whatever value is set in the middleware layer
Would you accept a PR adding a dont_set_tonic_version_in_user_agent (bikeshed pending) method on Channel to fix this issue?