Skip to content

Commit

Permalink
Merge pull request #773 from Fattouche/bump_dns_limits
Browse files Browse the repository at this point in the history
Replace hard coded per_page parameter on DNS API with default
  • Loading branch information
jacobbednarz authored Jan 10, 2022
2 parents 546e02e + 51d9037 commit 9a6a709
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
3 changes: 1 addition & 2 deletions dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ func (api *API) CreateDNSRecord(ctx context.Context, zoneID string, rr DNSRecord
func (api *API) DNSRecords(ctx context.Context, zoneID string, rr DNSRecord) ([]DNSRecord, error) {
// Construct a query string
v := url.Values{}
// Request as many records as possible per page - API max is 100
v.Set("per_page", "100")
// Using default per_page value as specified by the API
if rr.Name != "" {
v.Set("name", toUTS46ASCII(rr.Name))
}
Expand Down
1 change: 0 additions & 1 deletion dns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ func TestDNSRecords(t *testing.T) {

handler := func(w http.ResponseWriter, r *http.Request) {
assert.Equal(t, http.MethodGet, r.Method, "Expected method 'GET', got %s", r.Method)
assert.Equal(t, "100", r.URL.Query().Get("per_page"))
assert.Equal(t, asciiInput.Name, r.URL.Query().Get("name"))
assert.Equal(t, asciiInput.Type, r.URL.Query().Get("type"))
assert.Equal(t, asciiInput.Content, r.URL.Query().Get("content"))
Expand Down

0 comments on commit 9a6a709

Please sign in to comment.