Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: legrostdg [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: 0.24



Subject: cannot install HTTP::Proxy with cpan
Hi, I am running on ArchLinux testing. Perl version: v5.10.0 built for x86_64-linux-thread-mult I tried to install HTTP::Proxy with cpan but a lot of tests failed... Felix Here is the log: cpan[6]> install HTTP::Proxy Running install for module 'HTTP::Proxy' Running Build for B/BO/BOOK/HTTP-Proxy-0.23.tar.gz Has already been unwrapped into directory /root/.cpan/build/HTTP-Proxy-0.23-TSdKVp Has already been made Running Build test t/00basic...........ok t/01pod.............skipped: Test::Pod 1.14 required for testing POD t/02pod-coverage....skipped: Test::Pod::Coverage 1.04 required for testing POD coverage t/05new.............ok t/10init............ok t/11log.............ok t/15accessors.......1/30 maxconn is deprecated, please use max_connections at t/15accessors.t line 42 maxserve is deprecated, please use max_keep_alive_requests at t/15accessors.t line 42 t/15accessors.......ok t/15deprecated......ok t/16stash...........ok t/17fstack..........ok t/18engine..........ok t/20dummy...........ok t/20keepalive.......ok t/22http............ok t/22transparent.....ok t/23connect.........ok t/23https...........skipped: Can't make this work with Crypt::SSLeay t/40push_filters....ok t/41filters.........ok t/42will_modify.....ok t/50hopbyhop........1/28 # Failed test 'Hop-by-hop Foo' # at t/50hopbyhop.t line 38. # got: undef # expected: 'foofoo' # Failed test 'Hop-by-hop Bar' # at t/50hopbyhop.t line 39. # got: undef # expected: 'barbar' # Failed test 'Connection header removed' # at t/50hopbyhop.t line 45. # got: 'foofoo' # expected: undef # Failed test 'Connection header removed' # at t/50hopbyhop.t line 46. # got: 'barbar' # expected: undef # Failed test 'Hop-by-hop Foo' # at t/50hopbyhop.t line 64. # got: undef # expected: 'foofoo' # Failed test 'Hop-by-hop Bar' # at t/50hopbyhop.t line 65. # got: undef # expected: 'barbar' # Failed test 'Connection header removed' # at t/50hopbyhop.t line 71. # got: 'foofoo' # expected: undef # Failed test 'Connection header removed' # at t/50hopbyhop.t line 72. # got: 'barbar' # expected: undef # Failed test 'Hop-by-hop Foo' # at t/50hopbyhop.t line 91. # got: undef # expected: 'foofoo' # Failed test 'Hop-by-hop Bar' # at t/50hopbyhop.t line 92. # got: undef # expected: 'barbar' # Failed test 'Hop-by-hop Baz' # at t/50hopbyhop.t line 93. # got: undef # expected: 'bazbaz' # Failed test 'Connection header removed' # at t/50hopbyhop.t line 99. # got: 'foofoo' # expected: undef # Failed test 'Connection header removed' # at t/50hopbyhop.t line 100. # got: 'barbar' # expected: undef # Looks like you failed 13 tests of 28. t/50hopbyhop........ Dubious, test returned 13 (wstat 3328, 0xd00) Failed 13/28 subtests t/50standard........ok t/50via.............ok t/51simple..........ok t/51simple2.........ok t/61simple..........ok t/61simple2.........ok t/64htmltext........ok t/64lines...........ok t/64tags............ok t/66htmlparser......ok t/67complete........ok t/67save............ok t/71rot13...........ok t/90diveintomark....ok Test Summary Report ------------------- t/50hopbyhop (Wstat: 3328 Tests: 28 Failed: 13) Failed tests: 3-4, 8-9, 12-13, 17-18, 21-23, 27-28 Non-zero exit status: 13 Files=35, Tests=439, 45 wallclock secs ( 0.37 usr 0.16 sys + 11.31 cusr 1.58 csys = 13.42 CPU) Result: FAIL Failed 1/35 test programs. 13/439 subtests failed. BOOK/HTTP-Proxy-0.23.tar.gz ./Build test -- NOT OK //hint// to see the cpan-testers results for installing this module, try: reports BOOK/HTTP-Proxy-0.23.tar.gz Running Build install make test had returned bad status, won't install without force Failed during this command: BOOK/HTTP-Proxy-0.23.tar.gz : make_test NO
Try this patch. The %hopbyhop has defines hop-by-hop headers in mixed case. Later a call to HTTP::Headers::Util::split_header_words() is called, but that function returns the keys in all lowercase. That causes comparisons to fail. The patch just normalizes all the keys to lowercase. All the tests pass for me on Ubuntu 9.04 Jaunty now with Perl 5.10.0.
--- lib/HTTP/Proxy/HeaderFilter/standard.pm.orig 2009-07-21 00:50:20.000000000 -0700 +++ lib/HTTP/Proxy/HeaderFilter/standard.pm 2009-07-21 00:53:15.000000000 -0700 @@ -32,7 +32,7 @@ if $message->isa( 'HTTP::Request' ) && $self->proxy->x_forwarded_for; # make a list of hop-by-hop headers - my %h2h = %hopbyhop; + my %h2h = map { lc $_ => 1 } keys %hopbyhop; my $hop = HTTP::Headers->new(); my $client = HTTP::Headers->new(); $h2h{ $_->[0] } = 1 @@ -43,7 +43,7 @@ $headers->scan( sub { my ( $k, $v ) = @_; - if ( $h2h{$k} ) { + if ( $h2h{lc $k} ) { $hop->push_header( $k => $v ); $headers->remove_header($k); }
On Tue Jul 21 04:03:28 2009, MAURICE wrote: Show quoted text
> Try this patch. > > The %hopbyhop has defines hop-by-hop headers in mixed case. Later a call > to HTTP::Headers::Util::split_header_words() is called, but that > function returns the keys in all lowercase. That causes comparisons to > fail. The patch just normalizes all the keys to lowercase. > > All the tests pass for me on Ubuntu 9.04 Jaunty now with Perl 5.10.0.
Thanks for the fix. split_header_words() returns lowercase keys since October 2008, but I was still using an older version. Applied, will be in HTTP::Proxy 0.24. -- BooK