Blair Zajac <[EMAIL PROTECTED]> writes:

> The following code works in libwww 5.53 but not in 5.60:
> 
> use strict;
> use LWP;
> 
> my $req =
> HTTP::Request->new('GET' => 
> 'http://cgi.liveauctions.ebay.com/aw-cgi/eBayISAPI.dll?ViewItem&item=597488836'
> );
> 
> my $ua = LWP::UserAgent->new;
> 
> my $res = $ua->request($req);
> 
> print $res->as_string;
> 
> 
> The problem is that the request for
> 
> http://cgi.liveauctions.ebay.com/aw-cgi/eBayISAPI.dll?ViewItem&item=597488836
> 
> returns the headers with a duplicated HTTP/1.0 200 OK line:
> 
> HTTP/1.0 200 OK
> Server: Microsoft-IIS/4.0
> Date: Mon, 12 Nov 2001 22:47:35 GMT
> HTTP/1.0 200 OK
> Server: Microsoft-IIS/4.0
> Date: Mon, 12 Nov 2001 22:47:35 GMT
> 
> With libwww 5.53 it'll return all of the headers and the response and change
> the bad header line into:
> 
>       Client-Bad-Header-Line: HTTP/1.0 200 OK
> 
> but with 5.60 I get this:
> 
>       500 (Internal Server Error) Bad header: HTTP/1.0 200 OK
>       Client-Date: Mon, 12 Nov 2001 23:02:45 GMT
> 
> Is there a way to duplicate the old behavior in the new libwww?

The old HTTP/1.0 protocol driver module was more lax.  The new driver
will probably also grow ways to deal with bad responses as this over
time.

For now what you can do it to force 5.60 to continue to use the old
driver (it is still present as LWP::Protocol::http10).  The easiest
way to achieve this it to set the environment variable
PERL_LWP_USE_HTTP_10 to a true value before you run your script.

Regards,
Gisle

Reply via email to