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

per_hostname_tls_settings: correct handling of query parameters #1440

Merged
merged 2 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions .changelog/1440.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
per_hostname_tls_setting: use `buildURI` for defining the query parameters when sorting
```
24 changes: 12 additions & 12 deletions per_hostname_tls_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ type HostnameTLSSettingsResponse struct {

// ListHostnameTLSSettingsParams represents the data related to per-hostname tls settings being retrieved.
type ListHostnameTLSSettingsParams struct {
Setting string
PaginationOptions
Limit int `url:"limit,omitempty"`
Offset int `url:"offset,omitempty"`
Hostname []string `url:"hostname,omitempty"`
Setting string `json:"-" url:"setting,omitempty"`
PaginationOptions `json:"-"`
Limit int `json:"-" url:"limit,omitempty"`
Offset int `json:"-" url:"offset,omitempty"`
Hostname []string `json:"-" url:"hostname,omitempty"`
}

// UpdateHostnameTLSSettingParams represents the data related to the per-hostname tls setting being updated.
Expand Down Expand Up @@ -69,8 +69,8 @@ func (api *API) ListHostnameTLSSettings(ctx context.Context, rc *ResourceContain
return []HostnameTLSSetting{}, ResultInfo{}, ErrMissingHostnameTLSSettingName
}

uri := fmt.Sprintf("/zones/%s/hostnames/settings/%s", rc.Identifier, params.Setting)
res, err := api.makeRequestContext(ctx, http.MethodGet, uri, params)
uri := buildURI(fmt.Sprintf("/zones/%s/hostnames/settings/%s", rc.Identifier, params.Setting), params)
res, err := api.makeRequestContext(ctx, http.MethodGet, uri, nil)
if err != nil {
return []HostnameTLSSetting{}, ResultInfo{}, err
}
Expand Down Expand Up @@ -158,9 +158,9 @@ type HostnameTLSSettingsCiphersResponse struct {
// ListHostnameTLSSettingsCiphersParams represents the data related to per-hostname ciphers tls settings being retrieved.
type ListHostnameTLSSettingsCiphersParams struct {
PaginationOptions
Limit int `url:"limit,omitempty"`
Offset int `url:"offset,omitempty"`
Hostname []string `url:"hostname,omitempty"`
Limit int `json:"-" url:"limit,omitempty"`
Offset int `json:"-" url:"offset,omitempty"`
Hostname []string `json:"-" url:"hostname,omitempty"`
}

// UpdateHostnameTLSSettingCiphersParams represents the data related to the per-hostname ciphers tls setting being updated.
Expand All @@ -183,8 +183,8 @@ func (api *API) ListHostnameTLSSettingsCiphers(ctx context.Context, rc *Resource
return []HostnameTLSSettingCiphers{}, ResultInfo{}, ErrMissingZoneID
}

uri := fmt.Sprintf("/zones/%s/hostnames/settings/ciphers", rc.Identifier)
res, err := api.makeRequestContext(ctx, http.MethodGet, uri, params)
uri := buildURI(fmt.Sprintf("/zones/%s/hostnames/settings/ciphers", rc.Identifier), params)
res, err := api.makeRequestContext(ctx, http.MethodGet, uri, nil)
if err != nil {
return []HostnameTLSSettingCiphers{}, ResultInfo{}, err
}
Expand Down
Loading