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:
parent
435357ac50
commit
a724084114
2 changed files with 5 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue