summaryrefslogtreecommitdiff
path: root/scrape.go
diff options
context:
space:
mode:
authorPhilipp Tanlak <philipp.tanlak@gmail.com>2024-11-24 13:08:25 +0100
committerGitHub <noreply@github.com>2024-11-24 13:08:25 +0100
commit26a033b3ec1269d3927831bda1749a484ed83733 (patch)
treec3ff3641baea401f066ad1b80ac239faaa5b2605 /scrape.go
parentd2aec146ac5a2aef4a87813be47e5e1dc7404c51 (diff)
Generate random user agent when non is provided (#76)
Diffstat (limited to 'scrape.go')
-rw-r--r--scrape.go9
1 files changed, 1 insertions, 8 deletions
diff --git a/scrape.go b/scrape.go
index 5b0f4e0..1667f42 100644
--- a/scrape.go
+++ b/scrape.go
@@ -134,7 +134,7 @@ func (s *Scraper) process(url string, depth int) {
request := &Request{
Method: http.MethodGet,
URL: url,
- Headers: defaultHeaders(),
+ Headers: http.Header{},
Cookies: s.Client.Jar,
Depth: depth,
}
@@ -231,10 +231,3 @@ func (s *Scraper) enqueueJob(url string, depth int) {
s.wg.Done()
}
}
-
-func defaultHeaders() http.Header {
- h := http.Header{}
- h.Set("User-Agent", "flyscrape/0.1")
-
- return h
-}