Subject: | noproxy option throws off LWP::UserAgent (patch provided) |
As documented, the "noproxy" option in WWW::Mechanize prevents
env_proxy() from being called:
use WWW::Mechanize;
my $ua = WWW::Mechanize->new(
noproxy => 1,
);
But WWW::Mechanize then passes it on to its super class LWP::UserAgent,
which barfs on it:
Unrecognized LWP::UserAgent options: noproxy at ./test.pl line 10
The attached patch fixes this by not passing the option to
LWP::UserAgent. Would be great if you could apply it.
-- Mike
Subject: | patch.txt |
diff --git a/lib/WWW/Mechanize.pm b/lib/WWW/Mechanize.pm
index 4952467..7367089 100644
--- a/lib/WWW/Mechanize.pm
+++ b/lib/WWW/Mechanize.pm
@@ -219,6 +219,7 @@ sub new {
quiet => 0,
stack_depth => 8675309, # Arbitrarily humongous stack
headers => {},
+ noproxy => 0,
);
my %passed_parms = @_;
@@ -241,7 +242,7 @@ sub new {
$self->{$parm} = $mech_parms{$parm};
}
$self->{page_stack} = [];
- $self->env_proxy() unless $parent_parms{noproxy};
+ $self->env_proxy() unless $mech_parms{noproxy};
# libwww-perl 5.800 (and before, I assume) has a problem where
# $ua->{proxy} can be undef and clone() doesn't handle it.