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

Update Porkbun API URL #11

Merged
merged 1 commit into from
Oct 12, 2024
Merged
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
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
Loading