HTTP Server Root
Synopsis
egr.eai.http.server_root=<context>:<path>
Default Value: not applicable
Besides its ability to handle SOAP calls and serve URLs returned as part of the response message of SOAP calls (like catalog images, generated article images, and exported geometries) the integrated HTTP server also provides a very simple general purpose HTTP server whose functionality is limited to serving GET requests for plain files.
The value of this option consists of a context and an absolute path, separated by a colon character. The <context> is matched against the beginning of the URL paths from incoming GET requests, and the <path> is interpreted as the absolute path of a directory within the local file system. Together they define a server root. The option can be used multiple times to define multiple server roots.
The <context> must begin and end with a slash character. The <path> must be absolute and should use the platforms default file name separator. If it does not end with a file name separator, a file name separator is appended.
When a GET request comes in, the HTTP server decodes escaped octets within the path of the request URL1 and replaces sequences of slash characters with a single slash. It then selects the server root whose context is the longest matching2 prefix of the request path. If no such server root is found, the server sends a 404 (Not Found) response message. Otherwise, it removes the context from the request path to form a relative request path.
The server then substitutes slashes within the relative request path with the platform’s default file name separator. If the resulting path contains two consecutive dots as an element, then the request is rejected with an 403 (Forbidden) response message. Otherwise, the path is appended to the absolute path specified for the server root to form the absolute path of the file to retrieve. If the resulting path does not represent a file, or cannot be opened for reading, the server sends a 404 (Not Found) response. Otherwise it sends a 200 (OK) response containing the file.
Footnotes
-
Escaped octets that do not represent an ASCII character are expected to be part of a sequence of escaped octets that forms the UTF-8 encoding of an Unicode character. If this is not the case, the behavior is undefined. ↩
-
The comparison of the context with the beginning of the request path is case sensitive. ↩