can then be used in assembling a URI. The reserved characters will
vary from context to context, but will always be drawn from this set:
reserved = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" | "$" |
"," | "[" | "]"
The last two characters were added by RFC 2732 [7]. In any
particular context, a sub-set of these characters will be reserved;
the other characters from this set MUST NOT be encoded when a string
is URL-encoded in that context. Other basic rules used to describe
URI syntax are:
hex = digit | "A" | "B" | "C" | "D" | "E" | "F" | "a" | "b"
| "c" | "d" | "e" | "f"
escaped = "%" hex hex
unreserved = alpha | digit | mark
mark = "-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")"
3. Invoking the Script
3.1. Server Responsibilities
The server acts as an application gateway. It receives the request
from the client, selects a CGI script to handle the request, converts
the client request to a CGI request, executes the script and converts
the CGI response into a response for the client. When processing the
client request, it is responsible for implementing any protocol or
transport level authentication and security. The server MAY also
function in a 'non-transparent' manner, modifying the request or
response in order to provide some additional service, such as media
type transformation or protocol reduction.
The server MUST perform translations and protocol conversions on the
client request data required by this specification. Furthermore, the
server retains its responsibility to the client to conform to the
relevant network protocol even if the CGI script fails to conform to
this specification.
If the server is applying authentication to the request, then it MUST
NOT execute the script unless the request passes all defined access
controls.
RFC 3875 CGI Version 1.1 October 2004
3.2. Script Selection
The server determines which CGI is script to be executed based on a
generic-form URI supplied by the client. This URI includes a
hierarchical path with components separated by "/". For any
particular request, the server will identify all or a leading part of
this path with an individual script, thus placing the script at a
particular point in the path hierarchy. The remainder of the path,
if any, is a resource or sub-resource identifier to be interpreted by
the script.
Information about this split of the path is available to the script
in the meta-variables, described below. Support for non-hierarchical
URI schemes is outside the scope of this specification.
3.3. The Script-URI
The mapping from client request URI to choice of script is defined by
the particular server implementation and its configuration. The
server may allow the script to be identified with a set of several
different URI path hierarchies, and therefore is permitted to replace
the URI by other members of this set during processing and generation
of the meta-variables. The server
1. MAY preserve the URI in the particular client request; or
2. it MAY select a canonical URI from the set of possible values
for each script; or
3. it can implement any other selection of URI from the set.
From the meta-variables thus generated, a URI, the 'Script-URI', can
be constructed. This MUST have the property that if the client had
accessed this URI instead, then the script would have been executed
with the same values for the SCRIPT_NAME, PATH_INFO and QUERY_STRING
meta-variables. The Script-URI has the structure of a generic URI as
defined in section 3 of RFC 2396 [2], with the exception that object
parameters and fragment identifiers are not permitted. The various
components of the Script-URI are defined by some of the
meta-variables (see below);
script-URI = "://" <server-name> ":" <server-port>
<script-path> "?" <query-string>
where is found from SERVER_PROTOCOL, <server-name>,
<server-port> and <query-string> are the values of the respective
=5= |