Skip Menu |

This queue is for tickets about the libwww-perl CPAN distribution.

Report information
The Basics
Id: 94654
Status: resolved
Priority: 0/
Queue: libwww-perl

People
Owner: Nobody in particular
Requestors: dam [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in:
  • 6.04
  • 6.05
Fixed in: (no value)



Subject: LWP::UserAgent: Bad http proxy specification 'http://[IPv6]...' [patch]
Forwarded from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=714961: Package: libwww-perl Version: 6.04-1 Tags: ipv6, patch The current version of LWP::UserAgent apparently dislikes IPv6 addresses given for proxies. Consider, e. g.: $ http_proxy=http://\[2001:db8::1\]:3128/ perl -e ' use strict; use warnings; require LWP::UserAgent; my $ua = LWP::UserAgent->new (); $ua->env_proxy (); my $r = $ua->get ("http://www.example.org/"); warn ($r->status_line ()); die () unless ($r->is_success ());' Bad http proxy specification 'http://[2001:db8::1]:3128/' at -e line 1 $ The patch hereby suggested turns it into: 200 OK at -e line 1. (provided that an IPv6 address of an active HTTP proxy is given.) TIA.
Subject: ipv6-http-proxy.patch
Description: allow ipv6 proxy specification Author: Ivan Shmakov <oneingray@gmail.com> Reviewed-By: Damyan Ivanov <dmn@debian.org> Bug-Debian: https://bugs.debian.org/714961 --- /usr/share/perl5/LWP/UserAgent.pm 2012-02-18 17:18:12.000000000 +0000 +++ /usr/share/perl5/LWP/UserAgent.pm 2013-07-04 18:24:36.000000000 +0000 @@ -985,7 +985,8 @@ my $url = shift; if (defined($url) && length($url)) { Carp::croak("Proxy must be specified as absolute URI; '$url' is not") unless $url =~ /^$URI::scheme_re:/; - Carp::croak("Bad http proxy specification '$url'") if $url =~ /^https?:/ && $url !~ m,^https?://\w,; + Carp::croak("Bad http proxy specification '$url'") + if $url =~ /^https?:/ && $url !~ m,^https?://(\w|\[),; } $self->{proxy}{$key} = $url; $self->set_my_handler("request_preprepare", \&_need_proxy)
From: ppisar [...] redhat.com
Dne Pá 11.dub.2014 16:57:06, DAM napsal(a): Show quoted text
> The current version of LWP::UserAgent apparently dislikes IPv6 > addresses given for proxies. Consider, e. g.: >
Just a nit pick: It's better to use non-possessive capturing group.
Subject: libwww-perl-6.19-Accept-proxy-URLs-with-IPv6-host-names.patch
From 572538753601755b4b6acace1d445bc8e1cc10c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com> Date: Thu, 16 Feb 2017 14:00:57 +0100 Subject: [PATCH] Accept proxy URLs with IPv6 host names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit <https://rt.cpan.org/Public/Bug/Display.html?id=94654> Signed-off-by: Petr Písař <ppisar@redhat.com> --- lib/LWP/UserAgent.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/LWP/UserAgent.pm b/lib/LWP/UserAgent.pm index ea03157..8549808 100644 --- a/lib/LWP/UserAgent.pm +++ b/lib/LWP/UserAgent.pm @@ -1039,7 +1039,7 @@ sub proxy my $url = shift; if (defined($url) && length($url)) { Carp::croak("Proxy must be specified as absolute URI; '$url' is not") unless $url =~ /^$URI::scheme_re:/; - Carp::croak("Bad http proxy specification '$url'") if $url =~ /^https?:/ && $url !~ m,^https?://\w,; + Carp::croak("Bad http proxy specification '$url'") if $url =~ /^https?:/ && $url !~ m,^https?://(?:\w|\[),; } $self->{proxy}{$key} = $url; $self->set_my_handler("request_preprepare", \&_need_proxy) -- 2.7.4