Skip to content

Commit

Permalink
Merge pull request #11 from mateoconlechuga/master
Browse files Browse the repository at this point in the history
Update Porkbun API URL
  • Loading branch information
RLado authored Oct 12, 2024
2 parents c42ad1c + 3f1e183 commit c41ef12
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 c41ef12

Please sign in to comment.