Skip to content

Commit

Permalink
Fix response status code check
Browse files Browse the repository at this point in the history
Any code under 300 is a success. The DuckDuckGo API is responding with a 202 as of today.
  • Loading branch information
kidandcat authored Jul 25, 2024
1 parent 1975058 commit 1e9fc90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/duckduckgo/internal/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (client *Client) Search(ctx context.Context, query string) (string, error)
}

defer response.Body.Close()
if response.StatusCode != http.StatusOK {
if response.StatusCode > 299 {
return "", ErrAPIResponse
}

Expand Down

0 comments on commit 1e9fc90

Please sign in to comment.