Skip to content

Commit

Permalink
Update POST route from /dns-alias to /dns-value
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerHendrickson committed Apr 29, 2022
1 parent d45858a commit f0e6b4f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/sdk/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions pkg/sdk/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() },
Expand All @@ -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() },
Expand All @@ -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)}
Expand Down

0 comments on commit f0e6b4f

Please sign in to comment.