Recognize URL schemata disregarding the case

This commit is contained in:
Petr Písař 2016-10-12 14:58:08 +02:00
parent 6b19bf707c
commit 3cd333e768
2 changed files with 49 additions and 0 deletions

View File

@ -0,0 +1,45 @@
From 5e0110a0e9a019b5acd107bf4b3593e95cf9cfb8 Mon Sep 17 00:00:00 2001
From: Andreas Koenig <andk@cpan.org>
Date: Sun, 10 Jul 2016 12:30:48 +0200
Subject: [PATCH] URL schemes are case-tolerant, so the regexp should have /i
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- thanks for the hint from Father C.
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
lib/CPAN.pm | 2 +-
lib/CPAN/FTP.pm | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/CPAN.pm b/lib/CPAN.pm
index 6e460a8..fdb7869 100644
--- a/lib/CPAN.pm
+++ b/lib/CPAN.pm
@@ -1066,7 +1066,7 @@ sub has_usable {
'Net::FTP' => [
sub {
my $var = $CPAN::Config->{ftp_proxy} || $ENV{ftp_proxy};
- if ($var and $var =~ /^http:/) {
+ if ($var and $var =~ /^http:/i) {
# rt #110833
for ("Net::FTP cannot handle http proxy") {
$CPAN::Frontend->mywarn($_);
diff --git a/lib/CPAN/FTP.pm b/lib/CPAN/FTP.pm
index 0c338c5..03a51fb 100644
--- a/lib/CPAN/FTP.pm
+++ b/lib/CPAN/FTP.pm
@@ -665,7 +665,7 @@ sub hostdleasy { #called from hostdlxxx
# Net::FTP can still succeed where LWP fails. So we do not
# skip Net::FTP anymore when LWP is available.
}
- } elsif ($url =~ /^http:/ && $CPAN::META->has_usable('HTTP::Tiny')) {
+ } elsif ($url =~ /^http:/i && $CPAN::META->has_usable('HTTP::Tiny')) {
require CPAN::HTTP::Client;
my $chc = CPAN::HTTP::Client->new(
proxy => $CPAN::Config->{http_proxy} || $ENV{http_proxy},
--
2.7.4

View File

@ -17,6 +17,8 @@ Patch3: CPAN-2.14-Emergency-fix-for-cpan-o.patch
# Do not use Net::FTP if ftp_proxy variable points to an HTTP server,
# CPAN RT#110833, fixed after 2.14
Patch4: CPAN-2.14-Prevent-trying-Net-FTP-when-an-ftp_proxy-variable-is.patch
# Recognize URL schemata disregarding the case, fixed after 2.14
Patch5: CPAN-2.14-URL-schemes-are-case-tolerant-so-the-regexp-should-h.patch
BuildArch: noarch
BuildRequires: coreutils
BuildRequires: findutils
@ -197,6 +199,7 @@ external download clients to fetch distributions from the net.
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
# Change configuration name
find -type f -exec sed -i -e 's/XCPANCONFIGNAMEX/cpan/g' {} \;
# Remove bundled modules
@ -229,6 +232,7 @@ make test
- Fix "cpan -O" invocation (CPAN RT#115786)
- Do not use Net::FTP if ftp_proxy variable points to an HTTP server
(CPAN RT#110833)
- Recognize URL schemata disregarding the case
* Wed May 18 2016 Jitka Plesnikova <jplesnik@redhat.com> - 2.11-366
- Perl 5.24 re-rebuild of bootstrapped packages