Skip Menu |

This queue is for tickets about the HTTP-Proxy CPAN distribution.

Report information
The Basics
Id: 105177
Status: resolved
Priority: 0/
Queue: HTTP-Proxy

People
Owner: Nobody in particular
Requestors: gregoa [...] cpan.org
Cc: slaven [...] rezic.de
AdminCc:

Bug Information
Severity: Important
Broken in: 0.303
Fixed in: 0.304



CC: slaven [...] rezic.de
Subject: via() broken in 0.030
The change in handling via() in 0.030 (commit e105876) looks broken; i.e. setting the via header in the new() constructor doesn't do anything. For details cf. http://bugs.debian.org/788350 This breaks the test suite of Furl. Cheers, gregor, Debian Perl Group
On 2015-06-11 16:37:43, GREGOA wrote: Show quoted text
> The change in handling via() in 0.030 (commit e105876) looks broken; > i.e. setting the via header in the new() constructor doesn't do > anything. > > For details cf. http://bugs.debian.org/788350 > > This breaks the test suite of Furl.
Probably can be fixed with the attached patch (untested). Regards, Slaven
Subject: 0001-fix-RT-105177.patch
From 85e68a7ef47c568260e6dc56f4dd3f5e278ba76c Mon Sep 17 00:00:00 2001 From: Slaven Rezic <slaven@rezic.de> Date: Fri, 12 Jun 2015 07:57:54 +0200 Subject: [PATCH] fix RT#105177 --- lib/HTTP/Proxy.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/HTTP/Proxy.pm b/lib/HTTP/Proxy.pm index c074d24..a74b797 100644 --- a/lib/HTTP/Proxy.pm +++ b/lib/HTTP/Proxy.pm @@ -90,6 +90,7 @@ sub new { port => 8080, stash => {}, timeout => 60, + via => undef, x_forwarded_for => 1, ); -- 2.1.2
On 2015-06-12 01:59:32, SREZIC wrote: Show quoted text
> On 2015-06-11 16:37:43, GREGOA wrote:
> > The change in handling via() in 0.030 (commit e105876) looks broken; > > i.e. setting the via header in the new() constructor doesn't do > > anything. > > > > For details cf. http://bugs.debian.org/788350 > > > > This breaks the test suite of Furl.
> > Probably can be fixed with the attached patch (untested). >
... and a test case.
Subject: 0001-test-case-for-RT-105177.patch
From ac07de25d6867b78c2f5930ea68451bff2d87c1e Mon Sep 17 00:00:00 2001 From: Slaven Rezic <slaven@rezic.de> Date: Fri, 12 Jun 2015 08:28:08 +0200 Subject: [PATCH] test case for RT#105177 --- t/15accessors.t | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/t/15accessors.t b/t/15accessors.t index f80fe73..0d2195e 100644 --- a/t/15accessors.t +++ b/t/15accessors.t @@ -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"); -- 2.1.2
Show quoted text
> > Probably can be fixed with the attached patch (untested).
Confirmed. Show quoted text
> ... and a test case.
The test fails; changing the number of tests from 15 to 16 works for me. Complete patch attached. Cheers, gregor
Subject: fix-via.patch
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");
On 2015-06-12 07:50:16, GREGOA wrote: Show quoted text
> > > Probably can be fixed with the attached patch (untested).
> > Confirmed. >
> > ... and a test case.
> > The test fails; changing the number of tests from 15 to 16 works for me. > > Complete patch attached.
Ouch and thanks. Regards, Slaven
On Fri Jun 12 16:10:12 2015, SREZIC wrote: Show quoted text
> On 2015-06-12 07:50:16, GREGOA wrote:
> > > > Probably can be fixed with the attached patch (untested).
> > > > Confirmed. > >
> > > ... and a test case.
> > > > > > Complete patch attached.
> > Ouch and thanks. >
Thanks everyone for the patches. I've applied all of them, and will make a new release later this week. -- BooK