Description: fix via accessor which was broken in 0.030
Origin: CPAN RT
Bug:
https://rt.cpan.org/Public/Bug/Display.html?id=105177
Forwarded:
https://rt.cpan.org/Public/Bug/Display.html?id=105177
Author: Slaven Rezic <slaven@rezic.de>
Reviewed-by: gregor herrmann <gregoa@debian.org>
Last-Update: 2015-06-12
--- a/lib/HTTP/Proxy.pm
+++ b/lib/HTTP/Proxy.pm
@@ -90,6 +90,7 @@
port => 8080,
stash => {},
timeout => 60,
+ via => undef,
x_forwarded_for => 1,
);
--- a/t/15accessors.t
+++ b/t/15accessors.t
@@ -28,7 +28,7 @@
# loop is not used/internal for now
);
-plan tests => 15 + keys %meth;
+plan tests => 16 + keys %meth;
for my $key ( sort keys %meth ) {
no strict 'refs';
@@ -38,6 +38,11 @@
like( $proxy->via(), qr!\(HTTP::Proxy/$HTTP::Proxy::VERSION\)$!,
"via has the correct default");
+{
+ my $my_via_proxy = HTTP::Proxy->new( via => 'VIA!VIA!VIA!' );
+ is( $my_via_proxy->via(), 'VIA!VIA!VIA!', 'custom via' );
+}
+
# test deprecated accessors
$proxy = HTTP::Proxy->new( maxserve => 127, maxconn => 255 );
is( $proxy->max_keep_alive_requests, 127, "deprecated maxserve");