Skip to content

Commit 3f7b4b0

Browse files
committedOct 14, 2021
Provide a User-Agent with requests.
1 parent c1f13b4 commit 3f7b4b0

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed
 

‎pkg/generators/CssGenerator.go

+12-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,18 @@ func (g *CssGenerator) fetch() (string, error) {
137137
Timeout: 15 * time.Second,
138138
}
139139

140-
resp, err := client.Get(g.Url)
140+
u, err := url.Parse(g.Url)
141+
if err != nil {
142+
return "", err
143+
}
144+
resp, err := client.Do(&http.Request{
145+
Method: "GET",
146+
URL: u,
147+
Header: map[string][]string{
148+
"User-Agent": {"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:93.0) Gecko/20100101 Firefox/93.0"},
149+
},
150+
})
151+
141152
if err != nil {
142153
return "", err
143154
}

0 commit comments

Comments
 (0)
Please sign in to comment.