Fix internal API error in geturl() call for Gandi.

In nic_gandi_update(), calling geturl() with a hash parameter is
incorrect usage, because geturl() calls either fetch_via_curl(@_) or
fetch_via_socket_io(@_), both of which contain "my %params = @_;" --
this causes a "Reference found where even-sized list expected" error
because @_ needs to be a list of key-value pairs to be assigned to
%params, not a reference to a hash containing those key-value pairs.

The fix is simply to remove the braces around the list of key-value
pairs from the geturl() parameters.
This commit is contained in:
Deven T. Corzine 2020-09-27 02:42:11 -04:00
parent 11a583b003
commit 0c6f4ef7c8

View file

@ -5743,13 +5743,13 @@ sub nic_gandi_update {
$url = "https://$config{$h}{'server'}$config{$h}{'script'}";
$url .= "/livedns/domains/$config{$h}{'zone'}/records/$hostname/$rrset_type";
my $reply = geturl({
my $reply = geturl(
proxy => opt('proxy'),
url => $url,
headers => $headers,
method => 'PUT',
data => $data,
});
);
unless ($reply) {
failed("%s -- Could not connect to %s.", $h, $config{$h}{'server'});
next;