fastCGI and redirect scripts

Michael Smith (mjs@cursci.co.uk)
Wed, 03 Jul 1996 15:03:03 +0100

Message-Id: <31DA7D96.2888632A@cursci.co.uk>
Date: Wed, 03 Jul 1996 15:03:03 +0100
From: Michael Smith <mjs@cursci.co.uk>
To: fastcgi-developers@openmarket.com
Subject: fastCGI and redirect scripts

Has anybody had any experience with fastCGI and scripts that cause
redirections?  Well this doesn't work (for me at least).  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"
  }

Well if I access it through normal CGI, fine - I get redirected to the
fastCGI home page.  But if I access through fastCGI I get "document
contains no data"

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?

Thanks for any help

Michael Smith
fastCGI's #1 fan