From f0e6b4f08cbac90e3ee338b6884f17dccc83e5ce Mon Sep 17 00:00:00 2001 From: TylerHendrickson Date: Thu, 28 Apr 2022 19:10:26 -0500 Subject: [PATCH] Update POST route from /dns-alias to /dns-value --- pkg/sdk/client.go | 2 +- pkg/sdk/client_test.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/sdk/client.go b/pkg/sdk/client.go index 6c3c826..bc6fcca 100644 --- a/pkg/sdk/client.go +++ b/pkg/sdk/client.go @@ -51,7 +51,7 @@ func (c *Client) UpdateAlias() (net.IP, error) { // and requests that the DNS alias maintained by the mydyndns web service be updated to that IP address. // It returns the apparent net.IP address or an error that caused the operation to fail. func (c *Client) UpdateAliasWithContext(ctx context.Context) (net.IP, error) { - return c.fetchIP(ctx, "POST", "dns-alias") + return c.fetchIP(ctx, "POST", "dns-value") } func (c *Client) fetchIP(ctx context.Context, method, path string) (ip net.IP, err error) { diff --git a/pkg/sdk/client_test.go b/pkg/sdk/client_test.go index 11d5f16..0fc637e 100644 --- a/pkg/sdk/client_test.go +++ b/pkg/sdk/client_test.go @@ -44,7 +44,7 @@ func TestClient(t *testing.T) { "UpdateAlias() 200 response", http.StatusOK, []byte("9.8.7.6"), - "/dns-alias", + "/dns-value", net.ParseIP("9.8.7.6"), func(*httptest.Server) error { return nil }, func(c *Client) (net.IP, error) { return c.UpdateAlias() }, @@ -53,7 +53,7 @@ func TestClient(t *testing.T) { "UpdateAlias() with unparseable IP", http.StatusOK, []byte("badip"), - "/dns-alias", + "/dns-value", nil, func(*httptest.Server) error { return &net.ParseError{Type: "IP address", Text: "badip"} }, func(c *Client) (net.IP, error) { return c.UpdateAlias() }, @@ -62,7 +62,7 @@ func TestClient(t *testing.T) { "UpdateAlias() with too long response body", http.StatusOK, []byte(strings.Repeat("a", maxIPStrLen+1)), - "/dns-alias", + "/dns-value", nil, func(*httptest.Server) error { return &net.ParseError{Type: "IP address", Text: strings.Repeat("a", maxIPStrLen)}