summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Gerus <rgerus@dpd.com.pl>2015-12-22 07:04:22 +0100
committerRobert Gerus <rgerus@dpd.com.pl>2015-12-22 07:04:22 +0100
commit56b01da9e55294362eb2a5776433959b5fc89580 (patch)
tree2a84965941b88827bda20301cdfbd0f4f1ce1fe6
parentd102c546cf41d7e42638beb32094ee8596f82596 (diff)
downloadgorepost-56b01da9e55294362eb2a5776433959b5fc89580.tar.gz
gorepost-56b01da9e55294362eb2a5776433959b5fc89580.tar.bz2
gorepost-56b01da9e55294362eb2a5776433959b5fc89580.tar.xz
gorepost-56b01da9e55294362eb2a5776433959b5fc89580.zip
Changed User-Agent header.
According to docs, it should work.
-rw-r--r--bot/helpers.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/bot/helpers.go b/bot/helpers.go
index 3e073e3..cab3b9c 100644
--- a/bot/helpers.go
+++ b/bot/helpers.go
@@ -28,7 +28,14 @@ func httpGet(link string) ([]byte, error) {
}
client := &http.Client{Transport: tr}
- resp, err := client.Get(link)
+ req, err := http.NewRequest("GET", link, nil)
+ if err != nil {
+ return []byte{}, err
+ }
+
+ req.Header.Set("User-Agent", "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.152 Safari/537.36")
+
+ resp, err := client.Do(req)
if err != nil {
return []byte{}, err
}