From 9179655803813fe344af4d698cc034ef3ab2ec4c Mon Sep 17 00:00:00 2001 From: Dave Smith Date: Sat, 21 Sep 2019 20:59:27 -0500 Subject: [PATCH] Fix 74 Use JSON:PP in Yandex --- ddclient | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ddclient b/ddclient index 38a38a3..408dfe8 100755 --- a/ddclient +++ b/ddclient @@ -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 {