Skip Menu |

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

Report information
The Basics
Id: 67155
Status: resolved
Priority: 0/
Queue: Net-HTTP

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

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



Subject: apache.t fails in a proxied environment, requiring force install
The apache.t test fails in a situation where www.apache.org is reachable, but the environment is behind a proxy which refuses TRACE requests. At my company, it was giving the following error: t/apache.t .. 1/6 # Test 3 got: "TRACE /libwww-perl HTTP/1.0\nHost: www.apache.org\nUser-Agent: Mozilla/5.0\nAccept-Language: no,en\nAccept: */*\nVia: 1.1 lvproxy02.lightningsource.com:3128 (squid/2.6.STABLE21)\nCache-Control: max- age=259200\nConnection: keep-alive\n\n" (t/apache.t at line 57) # Expected: "TRACE /libwww-perl HTTP/1.1\nHost: www.apache.org\nUser-Agent: Mozilla/5.0\nAccept-Language: no,en\nAccept: */*\n\n" # Line 1 is changed: # - "TRACE /libwww-perl HTTP/1.1\n" # + "TRACE /libwww-perl HTTP/1.0\n" # Got 3 extra lines at line 6: # + "Via: 1.1 lvproxy02.lightningsource.com:3128 (squid/2.6.STABLE21)\n" # + "Cache-Control: max-age=259200\n" # + "Connection: keep-alive\n" # t/apache.t line 57 is: ok($buf, <<EOT); Server closed connection without sending any data back at /Users/earino/.cpanm/work/1301678802.18970/Net-HTTP- 6.00/blib/lib/Net/HTTP/Methods.pm line 345. You'll note that in the GOT component there is a header of "Via: 1.1 lvproxy02.lightningsource.com:3128 (squid/2.6.STABLE21)" which allowed us to see that the problem seemed to be the proxy. I have turned test 3 into a "skip" test which sees if the Via header was returned. Please see the attached patch. However, although the test passes, we still see that Net::HTTP::Methods generates an error message: Server closed connection without sending any data back at /Users/earino/.cpanm/work/1301678802.18970/Net-HTTP- 6.00/blib/lib/Net/HTTP/Methods.pm line 345. This does not stop the module from being installed, however it may be something you wish to clean up. I am running: This is perl 5, version 12, subversion 3 (v5.12.3) built for darwin-2level On: Darwin office-1248-172-24-20-245.lightningsource.com 10.7.0 Darwin Kernel Version 10.7.0: Sat Jan 29 15:17:16 PST 2011; root:xnu-1504.9.37~1/RELEASE_I386 i386
Subject: fix-proxy-test.diff
--- apache.t.orig 2011-04-01 12:37:21.000000000 -0500 +++ apache.t 2011-04-01 12:57:38.000000000 -0500 @@ -54,7 +54,8 @@ } $buf =~ s/\r//g; - ok($buf, <<EOT); + my $is_proxied_request = exists $h{'Via'} ? "skip if proxied" : undef; + skip($is_proxied_request, $buf, <<EOT); TRACE /libwww-perl HTTP/1.1 Host: www.apache.org User-Agent: Mozilla/5.0
I've now uploaded Net-HTTP-6.01 where I made the test more laxed and also made live test skipped by default.