From 577bcddb2afc1d337ea2bbe74b5e6dc7c54f6c00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Guillot?= Date: Mon, 22 Jan 2018 20:43:03 -0800 Subject: [PATCH] Change user agent --- http/client.go | 5 ++--- version/version.go | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/http/client.go b/http/client.go index b8541a2c..09da43b4 100644 --- a/http/client.go +++ b/http/client.go @@ -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 " const requestTimeout = 300 const maxBodySize = 1024 * 1024 * 15 @@ -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 != "" { diff --git a/version/version.go b/version/version.go index 4f76433a..2b9c050d 100644 --- a/version/version.go +++ b/version/version.go @@ -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"