Ward Vandewege <[EMAIL PROTECTED]> writes:

> Yes there must be. I've tried the test program you sent in a
> previous message, and it works fine here (standalone, no
> mod-perl). But HTTP-Webtest nor Monkeywrench see the cookies my
> application sends.
> OK, I found out why. Apparently my mod-perl application sends
> responses to the browser _without any headers_, not even a 'HTTP/1.x
> 200 OK'. This is probably illegal, but none of the browsers seem to
> have a problem with it (except for some older IE versions, but they
> are completely hopeless anyway).

It is not really illegal.  It can be regarded as just being HTTP
version pre-1.0 (which LWP calls "HTTP/0.9").  But this is not a
general problem with mod-perl applications.  There must be something
wrong with your server side configuration or scripts.  Perhaps you
should enable the "PerlSendHeader" option on the server?

> So LWP has a problem attaching the META header fields to an empty
> header. It does generate the following lines apparently:
> HTTP/0.9 200 OK
> Client-Date: Thu, 06 Sep 2001 10:25:10 GMT
> Client-Peer:
> Fair enough, I guess, if empty headers are illegal.

Again, I would not call it illegal, but LWP only looks into the
document if it is told it is HTML.  In &LWP::Procotcol::collect you
will find:

    if ($parse_head && $response->content_type eq 'text/html') {
        $parser = HTML::HeadParser->new($response->{'_headers'});

One way to "fix" this would be to apply some extra heuristics in the
collect() function to figure out if this really is HTML when the
content-type header is missing.  One could look at the suffix of the
request URI or perhaps peek into the document.  But I'm not sure it is
worth it.  Isn't it better to just fix the server to supply the header.


Reply via email to