1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2025-02-08 20:47:13 +00:00

utils: dont set http.Client timeout to a default value

This commit is contained in:
Benbebop 2024-09-15 22:33:00 -06:00 committed by Diamond
parent 67f94a835a
commit 6f5a53063f

View file

@ -5,7 +5,6 @@ import (
"io" "io"
"net/http" "net/http"
"net/url" "net/url"
"time"
) )
// DefaultClient implements Client and wraps around the stdlib Client. // DefaultClient implements Client and wraps around the stdlib Client.
@ -19,12 +18,9 @@ func WrapClient(client http.Client) Client {
return DefaultClient(client) return DefaultClient(client)
} }
// NewClient creates a new client around the standard library's http.Client. The // NewClient creates a new client around the standard library's http.Client.
// client will have a timeout of 10 seconds.
func NewClient() Client { func NewClient() Client {
return WrapClient(http.Client{ return WrapClient(http.Client{})
Timeout: 10 * time.Second,
})
} }
func (d DefaultClient) NewRequest(ctx context.Context, method, url string) (Request, error) { func (d DefaultClient) NewRequest(ctx context.Context, method, url string) (Request, error) {