* words, they're useless unless your SERVER_PROTOCOL is "gopher".
Not necessarily. Each of the items could be of value to some scripts. For
instance, if I have a specialized server running on port 9999 which uses the
same scripts the one on port 80 does, then the port number may be important.
The same goes for SERVER_NAME.
* What should the spec say? Well, we could drop them or we could
* say they're only set if the protocol is "gopher". Either way
* is fine by me. What I feel is necessary is that (1) be _the_
* method for self-referencing URLs. That way, gateway scripts
* can be used nicely as x-exec: scripts with 0 changes.
*/
Hang on, you're confusing me. If it's a self-referencing *URL*, then you
should be able to include port and hostname any way since it is a URL. In
what context are you building these self-referencing URLs? For the Location:
header? For HTML links?
The problem I see here is not that there are extra variables, it's that
sending back URLs to non-HTTP clients won't usually work. This is a serious
problem, and is a possible red flag for making CGI work for non-HTTP servers.
I can thus see two solutions, both are ugly:
1. Make the scripts ensure that they are running from an HTTP server when
returning URLs.
2. Make the non-URL servers (basically everything non-HTTP) handle URLs
coming back from scripts.
Unfortunately both are ugly. I would prefer (2), but that's probably only
because I'm not the one who has to implement it. It would make scripts a lot
simpler, though. John? Ideas?
--Rob