Skip to content

transport: re-think user agents - change from replace to prepend? #494

Open
@broady

Description

@broady

Currently, we allow users to set the User-Agent header via the WithUserAgent client option.

There's also the "UserAgent" field in the JSON/REST generated clients (this repo) which is appended to the default user agent (googleapi.UserAgent).

This option sets the User-Agent in its entirety, which means the client doesn't send its default User-Agent. It also makes it a bit more difficult for intermediary libraries to allow their users to set the User-Agent (think about a terraform library, for instance, you could end up with three user agents: end user, terraform, api client).

We might need some way to prepend user agent strings.

Questions:

  • do we actually to make a change? is our default User-Agent important?
  • prepend or append?

see PR #490

if t.userAgent != "" {
// TODO(cbro): append to existing User-Agent header?
newReq.Header.Set("User-Agent", t.userAgent)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions