Change user agent
This commit is contained in:
parent
da5c8c2edb
commit
577bcddb2a
2 changed files with 3 additions and 4 deletions
|
@ -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
|
||||
|
||||
|
@ -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 != "" {
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue