-
Notifications
You must be signed in to change notification settings - Fork 321
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
Add User-Agent header to oauth2 requests #386
Add User-Agent header to oauth2 requests #386
Conversation
ef6984c
to
ebd7f04
Compare
Signed-off-by: clayton-gonsalves <[email protected]>
ebd7f04
to
99a1aca
Compare
Can you please be more specific with the issue you try to solve? |
I have updated the PR description My usecase: |
I don't think we should expose this to users. I agree we could pass on the Blackbox Exporter and Prometheus user agents. Can you move to code to an http option like WithIdleConnTimeout ? |
I did think about this but there are a couple of reasons i wanted to expose this to users of this pkg:
Maybe we can keep a default UA(prometheus/blackbox) and allow the user the customise if needed? |
In BBE's case, it would be exposed to the user, but not directly with the http config. |
Isn't the |
Yes, but it is valid for users to change it. User agent is already set in many cases, I think we should just make sure to move it here with an http option so it's also applied to oauth 2. |
Do you mean adding it as an optional func to the http client? |
What about #387 |
LGTM |
This PR adds the ability to specify the User-Agent header for oauth2 requests.
The default User-Agent:
go-http-client/1.1
is ratelimited by many sites which leads to a lot of oauth2 requests failing.Fixes: 384