Compare commits

...

2 Commits

Author SHA1 Message Date
82702848f9 fix 2025-04-13 15:35:58 +02:00
b079790183 reverse test 2025-04-13 15:26:35 +02:00

View File

@@ -212,12 +212,13 @@ func (c *Client) do(ctx context.Context, method, relativeURL string, reqBody int
if err != nil {
return fmt.Errorf("unable to parse URL: %s %s %w", method, relativeURL, err)
}
if !strings.Contains(relativeURL, "firewall/zone") {
c.apiPath = c.apiV2Path
}
if !strings.HasPrefix(relativeURL, "/") && !reqURL.IsAbs() {
if strings.Contains(relativeURL, "firewall/zone") {
reqURL.Path = path.Join(c.apiV2Path, reqURL.Path)
} else {
reqURL.Path = path.Join(c.apiPath, reqURL.Path)
}
}
url := c.baseURL.ResolveReference(reqURL)
req, err := http.NewRequestWithContext(ctx, method, url.String(), reqReader)