httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@ai.mit.edu (Robert S. Thau)
Subject Re: CGI specification (was Re: restructuring the server)
Date Thu, 27 Apr 1995 18:23:23 GMT
   Date: Thu, 27 Apr 95 21:30 BST
   From: drtr@ast.cam.ac.uk (David Robinson)

   Except I'm trying to write a standard, instead of a description of
   what apache does. I suppose a 'conformant' CGI script is allowed
   to look at SERVER_SOFTWARE and make extra assumptions based on that.

Hmmm... The following describes every CGI implementation that I'm
aware of, except for behavior in pathological cases (e.g., the case in
which 1.3 doesn't even invoke the script) --- in particular, if I read
the code right, it always describes CERN, and it always describes NCSA
1.4 and Apache:

   The server maps *prefixes* of URLs onto actual scripts in a
   server-defined manner.  When a script is invoked, SCRIPT_URI is set
   to the prefix which caused the server to select that particular
   script, and the rest of the URL (if any) is available in PATH_INFO.
   The details of this mapping of SCRIPT_URIs to actual scripts are
   outside the scope of the CGI spec.  However, regardless of the
   details of the mapping, the following must always be true:

   There is at least one URL which causes the script to be invoked
   with SCRIPT_URI set to that URL, and PATH_INFO set to the null
   string.  Appending any string which begins with '/' to any such URL
   will cause the script to be invoked with the appended string as
   PATH_INFO.

   Conversely, when any script is invoked, it shall be the case that
   SCRIPT_URI and PATH_INFO, when concatenated, are the same as the
   URL that caused the script to be invoked, and that submitting
   SCRIPT_URI on its own causes the same script to be invoked with
   null PATH_INFO.

This language makes no reference to the internals of Apache, or NCSA
1.4.  What's more important any server can implement this
specification without constraining the way it finds scripts in any
way, shape or form.

In fact, I can't think of a way to write a CGI script which usefully
uses PATH_INFO without being able to count on the above-specified
behavior (again, barring failure to handle pathological cases).

   And yes, I'd rather be less non-committal, but that's the way
   things are.

Are they?  What servers do anything different?

rst



Mime
View raw message