Skip to content

Commit

Permalink
Change user agent
Browse files Browse the repository at this point in the history
  • Loading branch information
fguillot committed Jan 23, 2018
1 parent da5c8c2 commit 577bcdd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions http/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ import (

"github.com/miniflux/miniflux/logger"
"github.com/miniflux/miniflux/timer"
"github.com/miniflux/miniflux/version"
)

// Note: Some websites have a user agent filter.
const userAgent = "Mozilla/5.0 (like Gecko, like Safari, like Chrome) - Miniflux <https://miniflux.net/>"
const requestTimeout = 300
const maxBodySize = 1024 * 1024 * 15

Expand Down Expand Up @@ -136,7 +135,7 @@ func (c *Client) buildClient() http.Client {

func (c *Client) buildHeaders() http.Header {
headers := make(http.Header)
headers.Add("User-Agent", userAgent)
headers.Add("User-Agent", "Mozilla/5.0 (compatible; Miniflux/"+version.Version+"; +https://miniflux.net)")
headers.Add("Accept", "*/*")

if c.etagHeader != "" {
Expand Down
2 changes: 1 addition & 1 deletion version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
package version

// Version of the application (generated with "make build")
var Version = "undefined"
var Version = "2.0.x-dev"

// BuildDate is generated with "make build"
var BuildDate = "undefined"

0 comments on commit 577bcdd

Please sign in to comment.