Skip to content

Commit

Permalink
fix(porkbun): update API url (#837)
Browse files Browse the repository at this point in the history
  • Loading branch information
likeaninja5 authored Oct 12, 2024
1 parent 94e008d commit 118132f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/provider/providers/porkbun/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type dnsRecord struct {
// See https://porkbun.com/api/json/v3/documentation#DNS%20Retrieve%20Records%20by%20Domain,%20Subdomain%20and%20Type
func (p *Provider) getRecords(ctx context.Context, client *http.Client, recordType, owner string) (
records []dnsRecord, err error) {
url := "https://porkbun.com/api/json/v3/dns/retrieveByNameType/" + p.domain + "/" + recordType + "/"
url := "https://api.porkbun.com/api/json/v3/dns/retrieveByNameType/" + p.domain + "/" + recordType + "/"
if owner != "@" {
// Note Porkbun requires we send the unescaped '*' character.
url += owner
Expand Down Expand Up @@ -54,7 +54,7 @@ func (p *Provider) getRecords(ctx context.Context, client *http.Client, recordTy
// See https://porkbun.com/api/json/v3/documentation#DNS%20Create%20Record
func (p *Provider) createRecord(ctx context.Context, client *http.Client,
recordType, owner, ipStr string) (err error) {
url := "https://porkbun.com/api/json/v3/dns/create/" + p.domain
url := "https://api.porkbun.com/api/json/v3/dns/create/" + p.domain
postRecordsParams := struct {
SecretAPIKey string `json:"secretapikey"`
APIKey string `json:"apikey"`
Expand Down Expand Up @@ -83,7 +83,7 @@ func (p *Provider) createRecord(ctx context.Context, client *http.Client,
// See https://porkbun.com/api/json/v3/documentation#DNS%20Edit%20Record%20by%20Domain%20and%20ID
func (p *Provider) updateRecord(ctx context.Context, client *http.Client,
recordType, owner, ipStr, recordID string) (err error) {
url := "https://porkbun.com/api/json/v3/dns/edit/" + p.domain + "/" + recordID
url := "https://api.porkbun.com/api/json/v3/dns/edit/" + p.domain + "/" + recordID
postRecordsParams := struct {
SecretAPIKey string `json:"secretapikey"`
APIKey string `json:"apikey"`
Expand Down Expand Up @@ -111,7 +111,7 @@ func (p *Provider) updateRecord(ctx context.Context, client *http.Client,

// See https://porkbun.com/api/json/v3/documentation#DNS%20Delete%20Records%20by%20Domain,%20Subdomain%20and%20Type
func (p *Provider) deleteRecord(ctx context.Context, client *http.Client, recordType, owner string) (err error) {
url := "https://porkbun.com/api/json/v3/dns/deleteByNameType/" + p.domain + "/" + recordType + "/"
url := "https://api.porkbun.com/api/json/v3/dns/deleteByNameType/" + p.domain + "/" + recordType + "/"
if owner != "@" {
// Note Porkbun requires we send the unescaped '*' character.
url += owner
Expand Down

0 comments on commit 118132f

Please sign in to comment.