michael watson (IAH-C) wrote:
Sorry for the confusion....
The code also actually attempts to print out HTML headers ie
"<HTML><HEAD> etc" but these DO NOT come through to the webpage -
instead, a bunch of special characters are printed out...
Right... because the <HTML> and <HEAD> tags are being (incorrectly)
shoved into the Content-type field by apache..
From the command line do:
HEAD http://my.web.host.com
I bet you'll see Content-Type: <HTML><HEAD> or something close to that.
Apache is expecting the first two lines of your output to be a content
type header.
I suspect that the reason you're running into this issue is because the
original code was never intended to be run as a Apache::Registry script,
and that the content type printing is being controlled by a global variable.
i.e.
print "Content-type: foo/bar\n\n" if($HEADER_PRINTED == 0);
$HEADER_PRINTED = 1;
That global variable is never being reset to 0, and thus all requests
(except the very first) end up being sent across without a header.
I could be wrong, but I would start grepping for 'Content-type' in the code.
Rob