Skip to content

Allow full control over User-Agent header - #2492

Open
teodordelibasic-db wants to merge 2 commits into
grpc:masterfrom
teodordelibasic-db:skip-user-agent-if-set
Open

Allow full control over User-Agent header#2492
teodordelibasic-db wants to merge 2 commits into
grpc:masterfrom
teodordelibasic-db:skip-user-agent-if-set

Conversation

@teodordelibasic-db

Copy link
Copy Markdown

Motivation

Currently, tonic appends its user-agent string (tonic/x.x.x) to any existing User-Agent header on a request. This means middleware and applications built on top of tonic cannot have full control over the User-Agent header.

This addresses the original request in #970 for full control over the User-Agent header.

Solution

Skip setting the User-Agent header if it has already been set on the request, giving users complete control when needed.

Testing

Updated existing unit tests to verify the new behavior preserves the request's user-agent unchanged.

Signed-off-by: teodordelibasic-db <teodor.delibasic@databricks.com>
@linux-foundation-easycla

Copy link
Copy Markdown

CLA Not Signed

@nathanielford nathanielford left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! If you sign the CLA we can get this merged. Small caveat; it's unclear if there will be another tonic release, so this may only ever exist in the repo.

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

Successfully merging this pull request may close these issues.

2 participants