Cloudflare Fix
Cloudflare was returning values not being matched properly by the regex expression. Numbers that were not Headers. This fix or patch should resolve that issue, by only collecting one match to JSON relevant data.
This commit is contained in:
parent
c44f446d34
commit
3e952e6892
1 changed files with 6 additions and 6 deletions
12
ddclient.in
12
ddclient.in
|
@ -5561,8 +5561,8 @@ sub nic_cloudflare_update {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Strip header
|
# Strip header
|
||||||
$reply =~ s/^.*?\n\n//s;
|
$reply =~ qr/{(?:[^{}]*|(?R))*}/mp;
|
||||||
my $response = eval {decode_json($reply)};
|
my $response = eval {decode_json(${^MATCH})};
|
||||||
unless ($response && $response->{result}) {
|
unless ($response && $response->{result}) {
|
||||||
failed("updating %s: invalid json or result.", $domain);
|
failed("updating %s: invalid json or result.", $domain);
|
||||||
next;
|
next;
|
||||||
|
@ -5598,8 +5598,8 @@ sub nic_cloudflare_update {
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
# Strip header
|
# Strip header
|
||||||
$reply =~ s/^.*?\n\n//s;
|
$reply =~ qr/{(?:[^{}]*|(?R))*}/mp;
|
||||||
$response = eval {decode_json($reply)};
|
$response = eval {decode_json(${^MATCH})};
|
||||||
unless ($response && $response->{result}) {
|
unless ($response && $response->{result}) {
|
||||||
failed("updating %s: invalid json or result.", $domain);
|
failed("updating %s: invalid json or result.", $domain);
|
||||||
next;
|
next;
|
||||||
|
@ -5625,8 +5625,8 @@ sub nic_cloudflare_update {
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
# Strip header
|
# Strip header
|
||||||
$reply =~ s/^.*?\n\n//s;
|
$reply =~ qr/{(?:[^{}]*|(?R))*}/mp;
|
||||||
$response = eval {decode_json($reply)};
|
$response = eval {decode_json(${^MATCH})};
|
||||||
if ($response && $response->{result}) {
|
if ($response && $response->{result}) {
|
||||||
success("updating %s: IPv$ipv address set to %s", $domain, $ip);
|
success("updating %s: IPv$ipv address set to %s", $domain, $ip);
|
||||||
$config{$domain}{"ipv$ipv"} = $ip;
|
$config{$domain}{"ipv$ipv"} = $ip;
|
||||||
|
|
Loading…
Reference in a new issue