Subject: | Bug in HTTP-ProxyPAC v0.01 |
Date: | Wed, 11 Nov 2009 17:04:30 +0000 |
To: | bug-HTTP-ProxyPAC [...] rt.cpan.org |
From: | "Gordon M Lack" <gml4410 [...] gsk.com> |
I notice that it copies the protocol from the requested URI.
So if http://my.example.com/ results in a proxy of http://my.proxy.com:800/
then
https://my.example.com/ results in a proxy of https://my.proxy.com:800/
and
ftp://my.example.com/ results in a proxy of ftp://my.proxy.com:800/
But that can't work as you can't run http, https and ftp on the same port+system!
I think it would be better to force the proxy protocol to always be http rather than copying the
request protocol.
Here's a patch:
--- lib/HTTP/ProxyPAC/Result.pm.orig 2006-05-25 03:05:27.000000000 +0100
+++ lib/HTTP/ProxyPAC/Result.pm 2009-11-11 17:01:09.380176000 +0000
@@ -19,7 +19,9 @@
if ($self->{type} ne 'DIRECT') {
my $proxy = URI->new;
- $proxy->scheme($url->scheme); # same scheme as the target host
+# Proxy will use HTTP regardless of request scheme
+# $proxy->scheme($url->scheme); # same scheme as the target host
+ $proxy->scheme('http');
$proxy->host_port($string);
$self->{lc($self->{type})} = $proxy;
-----------------------------------------------------------
This e-mail was sent by GlaxoSmithKline Services Unlimited
(registered in England and Wales No. 1047315), which is a
member of the GlaxoSmithKline group of companies. The
registered address of GlaxoSmithKline Services Unlimited
is 980 Great West Road, Brentford, Middlesex TW8 9GS.
-----------------------------------------------------------