easydns: Fix extraction of result code from response body

The server returns a full HTML document, not just the result code.
Change equality check to a regex match that is resilient to
server-side changes.
This commit is contained in:
Richard Hansen 2024-07-20 02:43:31 -04:00
parent 435357ac50
commit a724084114
2 changed files with 5 additions and 2 deletions

View file

@ -127,6 +127,8 @@ repository history](https://github.com/ddclient/ddclient/commits/master).
* `easydns`: IPv4 and IPv6 addresses are now updated separately to be
consistent with the easyDNS documentation.
[#713](https://github.com/ddclient/ddclient/pull/713)
* `easydns`: Fixed parsing of result code from server response.
[#713](https://github.com/ddclient/ddclient/pull/713)
## 2023-11-23 v3.11.2

View file

@ -4821,9 +4821,10 @@ sub nic_easydns_update {
failed("$h: Could not connect to $config{$h}{'server'}");
next;
};
my ($status) = $body =~ qr/^(\S*)\b/;
my $resultcode_re = join('|', map({quotemeta} 'NOERROR', keys(%errors)));
my ($status) = $body =~ qr/\b($resultcode_re)\b/;
$config{$h}{"status-ipv$ipv"} = $status;
if ($status ne 'NOERROR') {
if (($status // '') ne 'NOERROR') {
if (exists $errors{$status}) {
failed("$h: $status: $errors{$status}");
} else {