You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Rodent of Unusual Size <co...@decus.org> on 1997/09/21 21:34:14 UTC

Hmmm.. "Status" header field from ErrorDocument CGIs?

    Here's a potentially interesting thought.

    If an ErrorDocument redirects to a CGI script, should the script
    propagate the error status (if available)?  In other words, should
    it contain something like the following Perl fragment?

     if ($rstatus = $ENV{'REDIRECT_STATUS'}) {
         print "Status: $rstatus";
     }

    I can't find it clearly defined anywhere.  (Nor mentioned at all,
    actually.)  I'm inclined that that this is Good behaviour, and
    should be encouraged, unless the error is one that should *not* have
    a content-body (e.g., 1xx, 204, 205, 304, et cetera, because the
    server will trim off the body in those cases and the whole point of
    customising the error is lost).

    Any thoughts?  (Particularly from Roy?)

    #ken    P-)}

Re: Hmmm.. "Status" header field from ErrorDocument CGIs?

Posted by Rob Hartill <ro...@imdb.com>.
On Sun, 21 Sep 1997, Rodent of Unusual Size wrote:

>     Here's a potentially interesting thought.
> 
>     If an ErrorDocument redirects to a CGI script, should the script
>     propagate the error status (if available)?  In other words, should
>     it contain something like the following Perl fragment?
> 
>      if ($rstatus = $ENV{'REDIRECT_STATUS'}) {
>          print "Status: $rstatus";
>      }

Not necessarily. The script might be performing error recovery, in
which case it can send a status that's not an error.


--
Rob Hartill                              Internet Movie Database (Ltd)
http://www.moviedatabase.com/   .. a site for sore eyes.


Re: Hmmm.. "Status" header field from ErrorDocument CGIs?

Posted by Paul Sutton <pc...@hyperreal.org>.
On Sun, 21 Sep 1997, Rodent of Unusual Size wrote:
>     If an ErrorDocument redirects to a CGI script, should the script
>     propagate the error status (if available)?  In other words, should
>     it contain something like the following Perl fragment?
> 
>      if ($rstatus = $ENV{'REDIRECT_STATUS'}) {
>          print "Status: $rstatus";
>      }
> 
>     I can't find it clearly defined anywhere.  (Nor mentioned at all,

I'm with RobH on this - it is purely a server issue and should not be
defined. The errordocument can chose what it wants to do - display an
error (in which case $rstatus would be appropriate), automaticlly "fix"
the URL display the correct page (or issue a redirect), or display a list
of possible matches (200, or maybe 306), maybe with cache-protection. 

//pcs