Skip Menu |

This queue is for tickets about the URI CPAN distribution.

Report information
The Basics
Id: 104301
Status: new
Priority: 0/
Queue: URI

Owner: Nobody in particular
Requestors: bitcard [...]

Bug Information
Severity: (no value)
Broken in:
  • 1.60
  • 1.61
  • 1.62
  • 1.63
  • 1.64
  • 1.65
  • 1.66
  • 1.67
Fixed in: (no value)

Subject: URI confused by port numbers with no scheme?
Download (untitled) / with headers
text/plain 1.4k
use URI; my $URI = new URI->new(''); print $URI->scheme,"\n"; Results in output '' Tracked this down after my cpanm as not working when attempting to use $http_proxy and $https_proxy environment variables. I kept getting the error: 501 Protocol scheme '' is not supported. This is because I had http_proxy set to, and cpanm calls LWP::UserAgent with env_proxy => 1. At some point, LWP::UserAgent calls $uri->scheme and it returns instead of undef. Snip from LWP::UserAgent send_request: # Locate protocol to use my $proxy = $request->{proxy}; if ($proxy) { $scheme = $proxy->scheme; } unless ($protocol) { $protocol = eval { LWP::Protocol::create($scheme, $self) }; $proxy is a URI::_foreign which is URI::_generic which overrides "no_scheme_ok" as being true. so calling $proxy->scheme returns the proxy name, then it tries to load that as a protocol resulting in the above error. I got lost when tracking down how calling ->scheme returns the hostname. URI version 999 required--this is only version 1.60. LWP::UserAgent version 999 required--this is only version 6.05. Also installed URI 1.67 via local::lib and same results ( returned as ->scheme). THe workaround (at least for cpanm) is to call the (as far as I can tell) undocumented --no-lwp command line option. Thanks, \- Mike
Download (untitled) / with headers
text/plain 395b
I dont know, maybe I'm mis-reading something, but from what i can tell is not a valid URI according to my brief reading of RFC 2396. Seems the convention of http_proxy and https_proxy not having the scheme specified is odd (and not valid) since they do not seem like valid relative URIs Was looking at: Page 26, the BNF for URI. \- Mike
Download (untitled) / with headers
text/plain 208b
the scheme being the hostname comes from new: my $impclass; if ($uri =~ m/^($scheme_re):/so) { $scheme = $1; } which seems like a valid thing to do after reading the RFC. \- Mike

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to