From c63eb0f0603bd44fe74cc3a529f248b766cb98c0 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Sat, 18 May 2024 01:00:19 -0400 Subject: [PATCH] godaddy: Fix dubious response body check It doesn't make sense to continue processing if the response body can't be parsed. Maybe GoDaddy returned 200 and there's a bug in the body parsing logic, in which case the `bad` result should actually be `good`. But it's better to assume that the update wasn't saved, in case the server returns 200 with a JSON object that semantically means "failed to update". --- ddclient.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ddclient.in b/ddclient.in index 884c64d..afb2e89 100755 --- a/ddclient.in +++ b/ddclient.in @@ -5776,9 +5776,10 @@ sub nic_godaddy_update { my $msg; $reply =~ s/^.*?\n\n//s; my $response = eval {decode_json($reply)}; - if (!defined($response) && $code != "200") { + if (!defined($response)) { $$status = "bad"; failed("%s.%s -- Unexpected or empty service response, cannot parse data.", $hostname, $zone); + next; } elsif (defined($response->{code})) { info("%s.%s -- %s - %s.", $hostname, $zone, $response->{code}, $response->{message}); }