Commit 84585f9
committed
Fix default User-Agent when using custom headers
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.1 parent e4729d0 commit 84585f9
2 files changed
+15
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
558 | 558 | | |
559 | 559 | | |
560 | 560 | | |
561 | | - | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
562 | 565 | | |
563 | 566 | | |
564 | 567 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1009 | 1009 | | |
1010 | 1010 | | |
1011 | 1011 | | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
1012 | 1023 | | |
1013 | 1024 | | |
1014 | 1025 | | |
| |||
0 commit comments