On Mon, Apr 18, 2011 at 08:46:15PM +0200, Stefan Fritsch wrote:
> On Monday 18 April 2011, Torsten Förtsch wrote:
> > On Monday, April 18, 2011 10:36:13 Joe Orton wrote:
> > > If you change the CGI script to send a 100 rather than 102, does
> > > it work?  LWP should treat all 1xx as interim responses so I'd
> > > say it is an LWP bug.
> > 
> > It is certainly triggered by the LWP version upgrade. I also agree
> > that it's a bug in LWP. But my question was also what do we test
> > here? If the purpose of the test is to see if the 102 response is
> > passed through (as suggested by the comment) then I'd think the
> > test is wrong too.
> 
> IMHO the purpose is to test if the real (200) response is passed 
> through.

I think I added this test specifically because mod_proxy used to only 
treat 100 as an interim response, not all 1xx responses.  This was fixed 
in:

  http://svn.apache.org/viewvc?view=revision&revision=102283

...
> Note that the test requests HTTP/1.0. RFC 2616 says "servers MUST NOT 
> send a 1xx response to an HTTP/1.0 client", so mod_proxy is correct 
> not to forward the 102 response to the client. Maybe the newer LWP 
> sends an HTTP/1.1 request? Can you confirm this with tcpdump? Which 
> version of LWP do you use?

I would guess you are right about LWP switching to HTTP/1.1.  We could 
work around this by forcing use of 1.0:

Index: t/modules/proxy.t
===================================================================
--- t/modules/proxy.t   (revision 1094342)
+++ t/modules/proxy.t   (working copy)
@@ -29,7 +29,11 @@
     ok t_cmp($r->content, "abcdef", "reverse proxied to dripfeed CGI content 
OK");
 
     if (have_min_apache_version('2.1.0')) {
-        $r = GET("/reverse/modules/cgi/nph-102.pl");
+        my $url = 
Apache::TestRequest::resolve_url("/reverse/modules/cgi/nph-102.pl");
+        my $req = HTTP::Request->new(GET => $url);
+        # force HTTP/1.0 to work around LWP 6.x bug
+        $req->protocol('HTTP/1.0');
+        $r = Apache::TestRequest::user_agent->request($req);
         ok t_cmp($r->code, 200, "reverse proxy to nph-102");
         ok t_cmp($r->content, "this is nph-stdout", "reverse proxy 102 
response");
     } else {

Reply via email to