This should be an "if" instead of "unless"

return OK if $r->header_only;

header_only() will return true if the request method is HEAD.  You'll want
to simply return OK once you've gathered all the necessary outgoing headers
for HEAD requests.



Thanks,

Tim Tompkins
----------------------------------------------
Programmer / Staff Engineer
http://www.arttoday.com/
----------------------------------------------
----- Original Message -----
From: "martin langhoff" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, October 02, 2000 1:37 PM
Subject: $r->header_only question (feeling a newbie!)


> hi,
>
> I've been developing with mod_perl for a while, but, thanks to
> Richter's Embperl module and the excellent backwards compatibility
> (regarding CGI.pm) I had never got anywhere near Apache::Request -- for
> production, that is.
>
> Now I have this very silly question, that I've boiled down to this
> little snippet of code (which carries a remakable resemblance to the
> example found in page 146 of the Eagle Book):
> ----------------------
> #!/usr/bin/perl -w
> use strict;
> use Apache::Constants qw(:common);
>
> my $r = Apache->request;
> $r->content_type('text/html');
> $r->send_http_header;
>
> return OK unless $r->header_only; # THIS is the line I'm wondering about
>
> $r->print(<<END);
> <html><body><h1> Hello ! </h1>
> <address> martin</address></body></html>
> END
> 1;
>
> ------------------------
>
> The issue is that I don't understand clearly what is this line supposed
> to do. As it is, it'll make my script return an empty body ('document
> contains no data!' said Navigator). Commented out, the proper contents
> are sent. Reading the Eagle and `man Apache::Request` led me to thing
> that the line is there to stop processing if all the client wants are
> the headers (maybe because of a 'If-Modified-Since' parameter?).
>
> Now  shouldn't it be an 'if' instead of an 'unless'?
>
> Am I too dumb today? Or is it just that it's monday?
>
>
>
> martin
>

Reply via email to