Message31931
CGIHttpserver tries to reset the environment between calls to CGI scripts by setting various variables to '' if they are not needed in the current request. In some cases this is not the correct behaviour since the presence of a null value can be interpreted by a CGI script as being significant.
For example, if HTTP_COOKIE has a null value then a script doing the standard test:
if os.environ.has_key('HTTP_COOKIE'):
# get the cookie
will have trouble
The problem is that CGIHTTPserver.py resets the entries in the env array which is then passed to os.environ.update(), this can only overwrite the env variables, not remove them.
An alternative is to call
if os.environ.has_key(k):
del os.environ[k]
inside the loop that updates the empty keys, then these variables will not be passed on to the CGI script.
Steve
|
|
Date |
User |
Action |
Args |
2007-08-23 14:53:32 | admin | link | issue1711605 messages |
2007-08-23 14:53:32 | admin | create | |
|