diff --git a/validation.go b/validation.go index 73ece0b..976143b 100644 --- a/validation.go +++ b/validation.go @@ -34,6 +34,7 @@ func checkAccess(token string) (bool, error) { return false, errors.New("token string is empty") } // form the request to check the token + client := &http.Client{} req, err := http.NewRequest("GET", indieAuthTokenUrl, nil) if err != nil { return false, errors.New("error making the request for checking token access") @@ -41,7 +42,7 @@ func checkAccess(token string) (bool, error) { req.Header.Set("Accept", "application/json") req.Header.Set("Authorization", token) // send the request - res, err := http.Client{}.Do(req) + res, err := client.Do(req) if err != nil { return false, errors.New("error sending the request for checking token access") }