From 3f1e183ba906f6859aa51a917c914e579e3a6f82 Mon Sep 17 00:00:00 2001 From: Matthew Waltz Date: Fri, 11 Oct 2024 22:34:20 -0600 Subject: [PATCH] Update Porkbun API URL (fix #10) --- src/main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.go b/src/main.go index 10bf091..5ef12af 100644 --- a/src/main.go +++ b/src/main.go @@ -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) } @@ -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) } @@ -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) } @@ -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) }