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:

  1. 'Server:' The name and version of the server (e.g., 'GoServe/1.88').
  2. 'Date:' The message origination date and time (only if GMT can be determined).
  3. '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.
  4. 'Content-Type:' The value set by the TYPE parameter.
  5. 'Content-Length:' The length of the file (less 1, if TEXT was specified and the file ends in an EOF character).
  6. 'Content-Transfer-Encoding:' Currently always 'binary'.
  7. 'Expires:' Set to the current time (only if GMT is available and ERASE was specified on the FILE command).
  8. '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:

  1. 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).
  2. 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.
  3. 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.