Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@WGH-
Copy link
Collaborator

@WGH- WGH- commented Mar 10, 2021

When using non-nil hdr parameter with c.Request method, and not setting User-Agent header explicitly, it would be left unset (when it should've been set to c.UserAgent). This means that Go HTTP client would use the default "Go-http-client/2.0" string.

Suppressing the header altogether is still possible by setting it to empty string.

WGH- added 2 commits March 10, 2021 21:11
When using non-nil hdr parameter with c.Request method, and not setting
User-Agent header explicitly, it would be left unset (when it should've
been set to c.UserAgent). This means that Go HTTP client would use the default
"Go-http-client/2.0" string.

Suppressing the header altogether is still possible by setting it to
empty string.
Copy link
Member

@asciimoo asciimoo left a comment

Choose a reason for hiding this comment

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

Good point, thanks!

@asciimoo asciimoo merged commit e664321 into master Mar 15, 2021
@WGH- WGH- deleted the fix-user-agent branch March 21, 2021 22:09
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.

3 participants