Skip to content

Commit

Permalink
bump user agent
Browse files Browse the repository at this point in the history
  • Loading branch information
mccutchen committed Sep 4, 2024
1 parent 4760d36 commit 72b2306
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions fakebrowser/fakebrowser.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
// Not very sportsmanlike, but basically effective at letting us fetch page
// titles.
var DefaultHeaders = map[string]string{
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8",
"Accept-Language": "en-US,en;q=0.5",
"Referer": "https://duckduckgo.com/",
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/113.0",
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:130.0) Gecko/20100101 Firefox/130.0",
}

// Transport is an http.RoundTripper implementation that injects a set of
Expand Down
8 changes: 4 additions & 4 deletions fakebrowser/fakebrowser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/stretchr/testify/assert"
)

func mergeMaps(t *testing.T, maps ...map[string]string) map[string]string {
func mergeMaps(maps ...map[string]string) map[string]string {
result := make(map[string]string)
for _, m := range maps {
for k, v := range m {
Expand All @@ -33,7 +33,7 @@ func TestHeaderInjection(t *testing.T) {
"X-1": "in request",
"X-2": "in request",
},
wantHeaders: mergeMaps(t, DefaultHeaders, map[string]string{
wantHeaders: mergeMaps(DefaultHeaders, map[string]string{
"Accept-Encoding": "gzip", // added by stdlib http client
"X-1": "in request",
"X-2": "in request",
Expand All @@ -46,7 +46,7 @@ func TestHeaderInjection(t *testing.T) {
"X-1": "in request",
"X-2": "in request",
},
wantHeaders: mergeMaps(t, DefaultHeaders, map[string]string{
wantHeaders: mergeMaps(DefaultHeaders, map[string]string{
"Accept-Encoding": "gzip", // added by stdlib http client
"User-Agent": "in request", // will override value in DefaultHeaders
"X-1": "in request",
Expand All @@ -61,7 +61,7 @@ func TestHeaderInjection(t *testing.T) {
"X-1": "in request",
"X-2": "in request",
},
wantHeaders: mergeMaps(t, map[string]string{
wantHeaders: mergeMaps(map[string]string{
"Accept-Encoding": "gzip", // added by stdlib http client
"User-Agent": "custom-user-agent",
"X-1": "in request",
Expand Down

0 comments on commit 72b2306

Please sign in to comment.