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".
This commit is contained in:
parent
f82d2af0f2
commit
c63eb0f060
1 changed files with 2 additions and 1 deletions
|
@ -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});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue