httpd: summay of environment variables for cgi
Dirk Clemens
develop at cle-mens.de
Mon Sep 5 10:19:15 UTC 2005
Here is a list of environment variables divided into five categories:
standard & implemented in busybox-httpd:
SERVER_SOFTWARE
GATEWAY_INTERFACE
SERVER_PROTOCOL
SERVER_PORT
REQUEST_METHOD
PATH_INFO
SCRIPT_NAME
QUERY_STRING
REMOTE_ADDR
AUTH_TYPE
REMOTE_USER
CONTENT_TYPE
CONTENT_LENGTH
standard, but missing in busybox-httpd
SERVER_NAME
PATH_TRANSLATED
REMOTE_HOST
REMOTE_IDENT
standard, special HTTP_*, implemented
HTTP_COOKIE
HTTP_REFERER
additional by busybox-httpd
(PATH)
REQUEST_URI
SCRIPT_FILENAME
additional by busybox-httpd, enabled with
CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV
REMOTE_PORT
*******
Comments:
4 standard vars are not supported.
The definition of REMOTE_PORT has an own configuration parameter
to save one code line and in inetd-only configuraion
the shared function addEnvPort() with two lines effective code.
Is it that worth?
Perhaps it is better to change this with:
config CONFIG_FEATURE_HTTPD_SET_ADDITIONAL_ENV
bool " Support non standard environment variables for CGI
(REQUEST_URI,SCRIPT_FILENAME,REMOTE_PORT)"
default n
depends on CONFIG_FEATURE_HTTPD_CGI
help
...
********
The query string decoding error is still there. The standard says:
QUERY_STRING:
The information which follows the ? in the URL which referenced this
script. This is the query information. It should not be decoded in any
fashion. This variable should always be set when there is query
information, regardless of command line decoding.
Dirk
P.S.:
cgi spec: http://hoohoo.ncsa.uiuc.edu/cgi/env.html
More information about the busybox
mailing list