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

feat: add User-Agent header overwrite possibility #314

Closed
wants to merge 1 commit into from

Conversation

yohan-couppey
Copy link

Proposed Changes

This is a proposal to add the possibility to overwrite the User-Agent field when we do requests.

Example of use :

c := client.NewClient( fmt.Sprintf("https://%s:%s", "influx_url", "influx_proxy_port"), "influx_token" )
// Ensures background processes finishes
defer c.Close()

c.HTTPService().SetUserAgent("custom_user_agent")

Checklist

  • CHANGELOG.md updated
  • Rebased/mergeable
  • A test has been added if appropriate (doesn't seem appropriate)
  • Commit messages are in semantic format
  • Sign CLA (if not already signed)

@vlastahajek
Copy link
Contributor

Thanks for the PR.
However, there is no need to add overriding for any request header to client API.
There is general support for customizing HTTP requests via the Doer interface.

@yohan-couppey
Copy link
Author

yohan-couppey commented Mar 7, 2022

I agree that we can do it with the Doer interface, but it was more convenient as User-Agent is as common as the Authorization field and avoid a lot of code.

But I will continue to do it with the Doer interface then.

Thank you for your time, closing the 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

Successfully merging this pull request may close these issues.

2 participants