Refresh Header not set when there is no HTML body

[email protected] (Rolf Grossmann) Thu, 9 Sep 2010 15:33:21 +0200
Newsgroups perl.libwww
Message-ID <[email protected]>
Hi,

I've run into a bit of a problem after upgrading LWP from the (prettu
old ;)) 5.817 to the latest release. The symptom is that for a server
that only returns a document containing this one line

<META HTTP-EQUIV='Refresh' CONTENT='0;URL=http://some.server.com/'>

the "Refresh" header isn't returned anymore. After some investigation, I
found that the way the HTML Headers are parsed in LWP::UserAgent has
changed. Now, the HeadParser is not getting passed the responses header
object, but the code to set the response headers only gets called if a
body element is encountered (line 600). I guess the reasoning for that
change is so that the parsed body headers don't overwrite server
headers. However, for those (admittedly non-conforming) cases when there
is no body, the headers are not set at all.

Can somebody suggest a course of action? I'd offer a patch if I knew a
good solution. Should I just file a bug report? Please CC me on replies.

Thanks, Rolf.