fixed mod_python bug reported by David Oxley

<David.Oxley@workplace-systems.plc.uk> on Subversion dev list

* lib/sapi.py (ModPythonServer.getenv): derive SCRIPT_NAME from apache
    request instead of using mod_python's value


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@700 8cb11bc2-c004-0410-86c3-e597b4017df7
remotes/tags/1.0.0-rc1
rey4 2003-08-18 15:01:36 +00:00
parent 1ce3cc2174
commit bdc40661f6
1 changed files with 11 additions and 0 deletions

View File

@ -281,6 +281,17 @@ class ModPythonServer(ThreadedServer):
return cgi.escape(s, quote)
def getenv(self, name, value = None):
### Due to a bug in mod_python versions 3.0.3 and 2.7.8 and earlier
### SCRIPT_NAME needs to be handled specially
### see http://www.modpython.org/pipermail/mod_python/2003-August/003495.html
if name == 'SCRIPT_NAME':
path_len = len(self.request.path_info)
if path_len:
assert self.request.uri[-path_len:] == self.request.path_info
return self.request.uri[:-path_len]
try:
return self.request.subprocess_env[name]
except KeyError: