Fix 74 Use JSON:PP in Yandex

This commit is contained in:
Dave Smith 2019-09-21 20:59:27 -05:00
parent 9d2cdb9fb2
commit 9179655803
No known key found for this signature in database
GPG key ID: 17ABEFC537939108

View file

@ -1384,7 +1384,7 @@ sub init_config {
$proto = opt('protocol') if !defined($proto);
load_sha1_support() if ($proto eq "freedns");
load_json_support() if ($proto eq "cloudflare");
load_json_support() if (grep (/^$proto$/, ("cloudflare","yandex")));
if (!exists($services{$proto})) {
warning("skipping host: %s: unrecognized protocol '%s'", $h, $proto);
@ -4462,7 +4462,7 @@ sub nic_yandex_update {
# Strip header
$reply =~ s/^.*?\n\n//s;
my $response = JSON::Any->jsonToObj($reply);
my $response = eval { decode_json($reply) };
if ($response->{success} eq 'error') {
failed ("%s", $response->{error});
next;
@ -4493,7 +4493,7 @@ sub nic_yandex_update {
# Strip header
$reply =~ s/^.*?\n\n//s;
$response = JSON::Any->jsonToObj($reply);
$response = eval { decode_json($reply) };
if ($response->{success} eq 'error') {
failed ("%s", $response->{error});
} else {