|
From: Jonathan S. <gel...@ge...> - 2002-02-10 17:35:41
|
On Sun, 10 Feb 2002, Dave Cross wrote:
> On Fri, Feb 08, 2002 at 11:56:40PM +0530, Suresh Sundriyal (sur...@ya...) wrote:
> > 1) On line 119 of textcounter script you have a
> > "print header;" . Since a textcounter script will be
> > called with SSI only the output of the script will be
> > included in the HTML that calls the script. So apart from
> > the count you will also get an etra line stating "Content-
> > Type: text/html; charset=ISO-8859-1".
>
> My understanding is that an SSI script _should_ return a Content-type
> header. I assume you're using <!--#exec cgi="..."-->.
>
I'm with Dave.
First thing to bear in mind that SSI is only a 'de facto' standard really
driven by the first implementations which were the NCSA httpd and later
Apache, most other HTTP servers follow these implementations but clearly
there is no real 'standard' apart from that described in:
http://httpd.apache.org/docs/mod/mod_include.html
Now there is a clear distinction made here between 'exec cgi' and 'exec
cmd' - obviously as CGI program must (as per the specification for that
interface) return a set of headers and not just the plain content, whereas
something executed via 'exec cmd' could quite easily be a shell command
such as 'ls' which will not emit any CGI headers.
If however your web server is transmitting the headers for an 'exec cgi'
that is non-standard and counter intuitive IMO. I see that we have two
options (not necessarily mutually exclusive) here - we can have a
configuration option (say $emit_headers) that can control the output of
the headers, thus allowing people to choose which of the 'cgi' or 'cmd'
behaviours they would like or we can build in some logic so that if the
program is being run be certain specified servers it will not be
outputting the headers anyway - of course to achieve this we will need to
discover the $ENV{SERVER_SOFTWARE} (or whatever) of all of the servers
that behave like this.
So in the first instance could you confirm to us that you are using 'exec
cgi' and if so could you send us the output of:
use CGI qw(:standard);
print header('text/plain');
foreach $env ( keys %ENV )
{
print "$env => $ENV{$env}\n";
}
When run as a CGI program.
Thanks
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
|