what's a CGI to do?...

Dave Kristol (dmk@allegra.att.com)
Tue, 28 Nov 95 12:24:32 EST


A user of my server software writes:

1. I have a method=post form whose action is T1, a cgi script.
2. T1 reads the post data, does some stuff, and then emits
"location: /T2" back to the server. T2 is a script.
3. T2 seems to get the POST information in its environment,
even though T1 already read it.
4. If T2 tries to read the POST information, it fails (of course).

This doesn't happen with NCSA [httpd].

Let me paraphrase the problem. NCSA httpd (and my server) allow a CGI
to give a "local" Location: header that causes the server to process
the resulting redirection without first sending anything to the client.
Beyond that I think the "correct" behavior is undefined. So I'm trying
to define it.

Some questions that come up are:

1) What should the method be for the redirected request?
(N.B. I think the behavior should be consistent with what happens for a
"full" URL that gets returned to a client.)

2) If the method should indeed be POST, where does the content come from?
(POST requires Content-Type and Content-Length headers.)

3) Should there be a way for a CGI to specify the method to use with a
redirection? If yes, only for local URLs, or for full ones, too?

4) What environment should be passed to a CGI (like T2 above) that is
reached via a redirection?
(Here again, I think it should be the same as if a full URL got sent
back to the client, and the client made a new request.)

Comments?
Dave Kristol