develooper Front page | perl.libwww | Postings from November 2001

How to parse bad HTTP headers in 5.60

Thread Next
From:
Blair Zajac
Date:
November 12, 2001 15:06
Subject:
How to parse bad HTTP headers in 5.60
Message ID:
3BF055BF.418AA314@orcaware.com
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?

Best,
Blair

-- 
Blair Zajac <blair@orcaware.com> - Perl & sysadmin services for hire
Web and OS performance plots - http://www.orcaware.com/orca/

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About