Skip to content

Commit cbbe049

Browse files
henrybarretogustavosbarreto
authored andcommitted
fix(pkg): use general http client on firewall evaluate
1 parent f58c99e commit cbbe049

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

pkg/api/internalclient/firewall.go

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@ package internalclient
33
import (
44
"context"
55
"errors"
6-
"net"
76
"net/http"
8-
9-
"github.com/go-resty/resty/v2"
107
)
118

129
// firewallAPI defines methods for interacting with firewall-related functionality.
@@ -22,17 +19,7 @@ var (
2219
)
2320

2421
func (c *client) FirewallEvaluate(ctx context.Context, lookup map[string]string) error {
25-
local := resty.New()
26-
local.AddRetryCondition(func(r *resty.Response, err error) bool {
27-
if _, ok := err.(net.Error); ok {
28-
return true
29-
}
30-
31-
return r.StatusCode() >= http.StatusInternalServerError && r.StatusCode() != http.StatusNotImplemented
32-
})
33-
34-
resp, err := local.
35-
SetRetryCount(10).
22+
resp, err := c.http.
3623
R().
3724
SetContext(ctx).
3825
SetQueryParams(lookup).

0 commit comments

Comments
 (0)