Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

firewall_rules/filter: reset fResponse on each loop to avoid residual data #1156

Merged
merged 4 commits into from
Dec 29, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changelog/1156.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
```release-note:bug
firewall_rules: use empty reponse struct on each page call
```
```release-note:bug
filter: use empty reponse struct on each page call
```
1 change: 1 addition & 0 deletions filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ func (api *API) Filters(ctx context.Context, rc *ResourceContainer, params Filte
var filters []Filter
var fResponse FiltersDetailResponse
for {
fResponse = FiltersDetailResponse{}
uri := buildURI(fmt.Sprintf("/zones/%s/filters", rc.Identifier), params)

res, err := api.makeRequestContext(ctx, http.MethodGet, uri, nil)
Expand Down
1 change: 1 addition & 0 deletions firewall_rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ func (api *API) FirewallRules(ctx context.Context, rc *ResourceContainer, params
var firewallRules []FirewallRule
var fResponse FirewallRulesDetailResponse
for {
fResponse = FirewallRulesDetailResponse{}
uri := buildURI(fmt.Sprintf("/zones/%s/firewall/rules", rc.Identifier), params)

res, err := api.makeRequestContext(ctx, http.MethodGet, uri, nil)
Expand Down