Skip to content

Commit

Permalink
feat: expose default user agent.
Browse files Browse the repository at this point in the history
  • Loading branch information
syhily committed Nov 15, 2022
1 parent 9467003 commit ae1e9e0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/argument/arguments.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var (
// Common flags.

Website = ""
UserAgent = ""
UserAgent = client.DefaultUserAgent
Proxy = ""
ConfigRoot = ""

Expand Down
4 changes: 2 additions & 2 deletions internal/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var (

const (
cookieFile = "cookies.json"
defaultUserAgent = "Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/13.0 Firefox/13.0"
DefaultUserAgent = "Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/13.0 Firefox/13.0"
)

// Client is the wrapper for resty.Client we may provide extra method on this wrapper.
Expand Down Expand Up @@ -78,7 +78,7 @@ func (c *Config) redirectPolicy() []any {

func (c *Config) userAgent() string {
if c.UserAgent == "" {
return defaultUserAgent
return DefaultUserAgent
}

return c.UserAgent
Expand Down

0 comments on commit ae1e9e0

Please sign in to comment.