Blob Blame History Raw
diff -up HTTP-Proxy-0.303/lib/HTTP/Proxy.pm.fixvia HTTP-Proxy-0.303/lib/HTTP/Proxy.pm
--- HTTP-Proxy-0.303/lib/HTTP/Proxy.pm.fixvia	2015-06-15 11:20:21.378357137 -0400
+++ HTTP-Proxy-0.303/lib/HTTP/Proxy.pm	2015-06-15 11:20:40.378389429 -0400
@@ -90,6 +90,7 @@ sub new {
         port     => 8080,
         stash    => {},
         timeout  => 60,
+	via      => undef,
         x_forwarded_for => 1,
     );
 
diff -up HTTP-Proxy-0.303/t/15accessors.t.fixvia HTTP-Proxy-0.303/t/15accessors.t
--- HTTP-Proxy-0.303/t/15accessors.t.fixvia	2015-06-15 11:22:14.585078744 -0400
+++ HTTP-Proxy-0.303/t/15accessors.t	2015-06-15 11:22:19.137043946 -0400
@@ -28,7 +28,7 @@ my %meth = (
     # 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 @@ for my $key ( sort keys %meth ) {
 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");