Subject: | Two problems |
Date: | Sat, 17 Nov 2018 09:20:14 -0500 |
To: | bug-Net-RDAP [...] rt.cpan.org |
From: | Alain Rioux <alain.rioux.610 [...] gmail.com> |
Hi,
I want to report two problems I had with the module Net::RDAP (0.11). Here
is the code I used:
use strict;
use Net::RDAP;
my $rdap = Net::RDAP->new;
my $object = $rdap->ip(Net::IP->new('123.123.123.123'));
The first problem is related to the path used for temp file. The problem is
at the line 281 of Registry.pm.
my $file = sprintf('%s/%s-%s', File::Spec->tmpdir, *$package*,
basename($url));
As it uses the package name in the filename (Net::RDAP::), it fails on
Windows because ":" is not allowed in a filename. I add a "$package =~
s/\:\:/-/g;" before the line to fix the problem.
The second problem I got is at the line 121 of Registry.pm:
return $package->assemble_url($package->get_best_url(@urls), 'ip',
*$ip->prefix*);
The url becomes "https://rdap.apnic.net/ip/123.123.123.123%2F32". The
result is a bad request error. The problem seems related to the uri
encoding, as "https://rdap.apnic.net/ip/123.123.123.123/32" will work.
Hope that helps!
Alain Rioux