Skip to content

Commit

Permalink
add proxy check
Browse files Browse the repository at this point in the history
  • Loading branch information
Chikage0o0 committed Sep 6, 2022
1 parent 8a0e69f commit 60d5700
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions http/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@ func (client *Client) SetProxy(CustomProxy string) error {
client.HTTPClient = &http.Client{
Transport: httpTransport,
}

httpUrl := "https://api.modrinth.com/"
response, err := client.HTTPClient.Get(httpUrl)
if err != nil {
return err
}
if response.StatusCode != http.StatusOK {
return err
}
return nil
}

Expand Down

0 comments on commit 60d5700

Please sign in to comment.