spoof user agent string for yahoo finance API
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Steven Polley 2025-05-07 12:06:39 -06:00
parent 0110941ac7
commit a34dca1076

View File

@ -26,6 +26,9 @@ func (c *client) get(endpoint string, out interface{}, query url.Values) error {
return err return err
} }
// Yahoo finance requires user agent string now?
req.Header.Set("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:138.0) Gecko/20100101 Firefox/138.0")
res, err := c.httpClient.Do(req) res, err := c.httpClient.Do(req)
if err != nil { if err != nil {
return fmt.Errorf("http get request failed: %v", err) return fmt.Errorf("http get request failed: %v", err)