Index: Lib/CGIHTTPServer.py =================================================================== --- Lib/CGIHTTPServer.py (revision 61179) +++ Lib/CGIHTTPServer.py (working copy) @@ -80,16 +80,20 @@ begins with one of the strings in the list self.cgi_directories (and the next character is a '/' or the end of the string). - """ + splitpath = os.path.split(os.path.normpath(self.path)) - path = self.path + if not splitpath[0] or splitpath[0] == '/': + splitpath = (''.join(splitpath), '') - for x in self.cgi_directories: - i = len(x) - if path[:i] == x and (not path[i:] or path[i] == '/'): - self.cgi_info = path[:i], path[i+1:] - return True + dirname = splitpath[0] + if dirname[0] != '/': + dirname = '/' + dirname + + if dirname in self.cgi_directories: + self.cgi_info = splitpath + return True + return False cgi_directories = ['/cgi-bin', '/htbin']