+ " command attribute");
throw new HTTPException(error);
}
// Ok:
Vector env = new Vector(32) ;
httpd server = request.getClient().getServer() ;
InetAddress sadr = server.getInetAddress() ;
// Specified environment variables:
// We do not handle the following variables:
// - REMOTE_IDENT: would require usage of IDENT protocol.
// Authentification type, if any:
String svalue = (String) request.getState(AuthFilter.STATE_AUTHTYPE);
if ( svalue != null )
addEnv("AUTH_TYPE", svalue, env);
// Content length, if available:
svalue = request.getValue("content-length");
if ( svalue != null )
addEnv("CONTENT_LENGTH", svalue, env);
// Content type, if available:
svalue = request.getValue("content-type");
if ( svalue != null )
addEnv("CONTENT_TYPE", svalue, env);
// The gateway interface, hopefully 1.1 !
addEnv ("GATEWAY_INTERFACE", "CGI/1.1", env) ;
// The PATH_INFO, which I am afraid I still don't understand:
svalue = (String) request.getState(STATE_EXTRA_PATH);
if ( svalue == null )
addEnv ("PATH_INFO", "/", env) ;
else
addEnv ("PATH_INFO", svalue, env) ;
// The query string:
query = request.getQueryString();
if ( query != null )
addEnv("QUERY_STRING", query, env) ;
// The remote client IP address:
svalue = request.getClient().getInetAddress().toString();
addEnv ("REMOTE_ADDR", svalue, env);
// Authentified user:
svalue = (String) request.getState(AuthFilter.STATE_AUTHUSER);
if ( svalue != null )
addEnv("REMOTE_USER", svalue, env);
// Remote host name, if allowed:
if ( checkRemoteHost() ) {
String host = request.getClient().getInetAddress().getHostName();
addEnv("REMOTE_HOST", host, env);
}
// The request method:
addEnv ("REQUEST_METHOD", request.getMethod(), env) ;
// The script name :
addEnv("SCRIPT_NAME", getURLPath(), env);
// Server name:
addEnv ("SERVER_NAME", getServer().getHost(), env) ;
// Server port:
svalue = Integer.toString(getServer().getLocalPort());
addEnv ("SERVER_PORT", svalue, env);
// Server protocol:
addEnv ("SERVER_PROTOCOL", request.getVersion(), env) ;
// Server software:
addEnv ("SERVER_SOFTWARE", server.getSoftware(), env) ;
if (getFileResource()!= null) {
addEnv("PATH_TRANSLATED",
getFileResource().getFile().getAbsolutePath(), env);
}