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

Re: HTTP standard problem

From:
Gisle Aas
Date:
November 2, 2001 09:06
Subject:
Re: HTTP standard problem
Message ID:
lrelnhxfvi.fsf@caliper.ActiveState.com
Roger Wegmann <wegmann@eurospider.com> writes:

> I use your LWP and have found a problem. The Microsoft webserver 
> (Microsoft-IIS/5.0) returns a wrong HTTP header field: "Content Location: 
> ..." without a '-' between "Content" and '"Location". The module Net::HTTP.pm 
> returns "500 Bad header: Content Location" that is correct. But how can I 
> force the LWP to download such documents nonetheless? Do you know a good work 
> around?

The solution will depend on which version of LWP.  I'm assume 5.60 here.

Locate the method 'read_header_lines' in Net::HTTP.  This is the one
responsible for reading the headers.

Either you simply patch this method by tweaking the first regexp so
that internal space is allowed.

Or you subclass LWP::Protocol::http so that you override this method
with your own.  Look at LWP::Protocol::https.pm for how to do this.
You then tell LWP to use your modified protocol driver with a call like:

 LWP::Protocol::implementor('http', 'MyOwn::HTTP');

Regards,
Gisle



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