Skip to content

Commit

Permalink
Update Porkbun API URL (fix #10)
Browse files Browse the repository at this point in the history
  • Loading branch information
mateoconlechuga committed Oct 12, 2024
1 parent c42ad1c commit 3f1e183
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func getIp(cfg domConfig) (ip, error) {
}

// Send API request
resp, err := client.Post("https://porkbun.com/api/json/v3/ping", "application/json", bytes.NewBuffer(reqBody))
resp, err := client.Post("https://api.porkbun.com/api/json/v3/ping", "application/json", bytes.NewBuffer(reqBody))
if err != nil {
return ipAddr, fmt.Errorf("error sending API request: %s", err)
}
Expand Down Expand Up @@ -216,7 +216,7 @@ func updateDns(cfg domConfig, ipAddr ip) (bool, error) {
}

// Send API request
resp, err := client.Post(fmt.Sprintf("https://porkbun.com/api/json/v3/dns/retrieveByNameType/%s/%s/%s", cfg.Domain, recordType, cfg.Subdomain), "application/json", bytes.NewBuffer(reqBody))
resp, err := client.Post(fmt.Sprintf("https://api.porkbun.com/api/json/v3/dns/retrieveByNameType/%s/%s/%s", cfg.Domain, recordType, cfg.Subdomain), "application/json", bytes.NewBuffer(reqBody))
if err != nil {
return false, fmt.Errorf("error sending API request: %s", err)
}
Expand Down Expand Up @@ -270,7 +270,7 @@ func updateDns(cfg domConfig, ipAddr ip) (bool, error) {
}

// Send API request
resp, err = client.Post(fmt.Sprintf("https://porkbun.com/api/json/v3/dns/edit/%s/%s", cfg.Domain, recordId), "application/json", bytes.NewBuffer(reqBody))
resp, err = client.Post(fmt.Sprintf("https://api.porkbun.com/api/json/v3/dns/edit/%s/%s", cfg.Domain, recordId), "application/json", bytes.NewBuffer(reqBody))
if err != nil {
return false, fmt.Errorf("error sending API request: %s", err)
}
Expand Down Expand Up @@ -319,7 +319,7 @@ func createRecord(cfg domConfig, ipAddr ip) (bool, error) {
}

// Send API request
resp, err := client.Post(fmt.Sprintf("https://porkbun.com/api/json/v3/dns/create/%s", cfg.Domain), "application/json", bytes.NewBuffer(req))
resp, err := client.Post(fmt.Sprintf("https://api.porkbun.com/api/json/v3/dns/create/%s", cfg.Domain), "application/json", bytes.NewBuffer(req))
if err != nil {
return false, fmt.Errorf("error sending API request: %s", err)
}
Expand Down

0 comments on commit 3f1e183

Please sign in to comment.