Re: fastCGI and redirect scripts

Mark Brown (mbrown@OpenMarket.com)
Fri, 05 Jul 1996 18:37:37 -0400

Message-Id: <199607052237.SAA27326@breckenridge.openmarket.com>
To: fastcgi-developers@OpenMarket.com
Subject: Re: fastCGI and redirect scripts 
In-Reply-To: Michael Smith's message of "Wed, 03 Jul 1996 15:03:03 BST."
             <31DA7D96.2888632A@cursci.co.uk> 
Date: Fri, 05 Jul 1996 18:37:37 -0400
From: Mark Brown <mbrown@OpenMarket.com>


Michael Smith reports:

    Consider the following simple perl script:

    #!/usr/local/bin/perl-fcgi
    use FCGI;
    while (FCGI::accept() >= 0) {
        print "Location:http://www.fastcgi.com/\n\n"
    }

    Accessing via telnet I see the following

    1) CGI

    HTTP/1.0 302 Found
    Date: Wed, 03 Jul 1996 14:01:23 GMT
    Server: Apache/1.1b4
    Location: http://www.fastcgi.com/
    Content-type: text/html

    <HEAD><TITLE>Document moved</TITLE></HEAD>
    <BODY><H1>Document moved</H1>
    The document has moved <A HREF="http://www.fastcgi.com/">here</A>.<P>
    </BODY>
    Connection closed by foreign host.

    2) FastCGI

    HTTP/1.0 200 OK
    Date: Wednesday, 03-Jul-96 14:01:27 GMT
    Server: Apache/1.1b4
    MIME-version: 1.0
    Location:http://www.fastcgi.com/ 

    Can anybody tell me what I am doing wrong - or what apache/fastCGI
    is doing wrong?

Reading the code, it looks like the mod_fastcgi header parser
requires white space (blank or tab) following the colon.  Apparently
the Apache CGI module's header parser doesn't.

Try
        print "Location: http://www.fastcgi.com/\n\n"

and see if that works.

This is probably a bug (have to consult the CGI spec), but see if
this works around it.

    --mark