[issue10484] http.server.is_cgi fails to handle CGI URLs containing PATH_INFO
report at bugs.python.org
Wed Nov 24 04:50:34 CET 2010
Glenn Linderman <v+python at g.nevcal.com> added the comment:
Here is a replacement for the body of is_cgi that will work with the current _url_collapse_path_split function, but it seems to me that it is ineffecient to do multiple splits and joins of the path between the two functions.
splitpath = server._url_collapse_path_split(self.path)
# more processing required due to possible PATHINFO parts
# not clear above function really does what is needed here,
# nor just how general it is!
splitpath = '/'.join( splitpath ).split('/', 2 )
head = '/' + splitpath[ 1 ]
tail = splitpath[ 2 ]
if head in self.cgi_directories:
self.cgi_info = head, tail
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list