Automatic HTTP processing
GoServe automates several aspects of the HTTP/1.0 protocol. (For full
details of the protocol, please see the HTTP specification.) When an
HTTP/1.0 request is received, the HTTP header lines are read
automatically (if needed). The Content-Length and If-Modified-Since
values are extracted as appropriate.
When a completion command is processed, GoServe will (if the incoming
request was HTTP/1.0) generate an appropriate response line and
HTTP header. For example, for a FILE command with a given file TYPE,
this will include the following header lines:
-
'Server:' The name and version of the server (e.g., 'GoServe/1.88').
-
'Date:' The message origination date and time (only if GMT can be
determined).
-
'Message-ID:' A unique identifier for the message. For example,
'<19950101121030.80.123@12.34.56.78>', which is the local date and
time that the server was started, the port which it is serving, and
the transaction number, followed by the primary host address. This
header is not required by the HTTP protocol, and so is only sent if
the GoServe TEST parameter is in effect.
-
'Content-Type:' The value set by the TYPE parameter.
-
'Content-Length:' The length of the file (less 1, if TEXT was
specified and the file ends in an EOF character).
-
'Content-Transfer-Encoding:' Currently always 'binary'.
-
'Expires:' Set to the current time (only if GMT is available and
ERASE was specified on the FILE command).
-
'Last-Modified:' Set to the timestamp of the file, converted to
GMT (only if GMT is available and ERASE was not specified).
Finally, GoServe will not actually send the body of the file if the
request verb was HEAD or (if the verb was not HEAD) if the
'Last-Modified' date is older or the same as the first
'If-Modified-Since' date found in the request header (if any). In this
latter case, the response line will be 'HTTP/1.0 304 Not Modified'.
Notes:
-
If the response line has been set explicitly by the RESPONSE
command, this overrides any possible "Not Modified" response, and
so the 'If-Modified-Since' check does not take place (that is, the
body of the response will be sent).
-
If the client does not send the header within a short time after
the request string, the 'If-Modified-Since' check may be bypassed.
This bypass is to allow for some older clients that are not fully
HTTP/1.0 compliant, and may be removed later.
-
GoServe does not automatically send a "MIME-Version" header field,
as it can make no guarantee that the message as a whole is
MIME-compliant (and in most cases it will not be).
[ previous section | GoServe | next section ]
From 'goserve.doc', version 2.32.
Copyright © International Business Machines Corporation, 1993, 1995.
All rights reserved.