You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apache-bugdb@apache.org by Yann Stettler <st...@thenet.ch> on 1997/04/08 15:40:02 UTC

mod_cgi/329: Wrong status checked for cgi-script that print back their own header

>Number:         329
>Category:       mod_cgi
>Synopsis:       Wrong status checked for cgi-script that print back their own header
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    apache (Apache HTTP Project)
>State:          open
>Class:          mistaken
>Submitter-Id:   apache
>Arrival-Date:   Tue Apr  8 06:40:01 1997
>Originator:     stettler@thenet.ch
>Organization:
apache
>Release:        1.2B7
>Environment:
Linux, Kernel 2.0.19. GCC 2.7.1
>Description:
When a cgi-script want to print itself his own header (for sending a 
redirection to the browser for example), he should print the line :
Status: 302 but instead a status of 200 is checked !
(The comments in the codes and the doc say that the script should use a
status of 302).

else if (location && r->status == 200) {
    /* XX Note that if a script wants to produce its own Redirect
     * body, it now has to explicitly *say* "Status: 302"
     */
     return REDIRECT;
}
>How-To-Repeat:
Use your sample script from the how-to doc for redirecting a URL by
using a cgi-script. :)
>Fix:
Choose if it shoudl be a status of 200 or 302 and either change the example/comments
or change the test in mod_cgi.c

%0
>Audit-Trail:
>Unformatted: