use the collapsed path in the run_cgi method (closes #19435)
diff --git a/Lib/CGIHTTPServer.py b/Lib/CGIHTTPServer.py
index 47a994c..50e0f7a 100644
--- a/Lib/CGIHTTPServer.py
+++ b/Lib/CGIHTTPServer.py
@@ -105,18 +105,17 @@
def run_cgi(self):
"""Execute a CGI script."""
- path = self.path
dir, rest = self.cgi_info
- i = path.find('/', len(dir) + 1)
+ i = rest.find('/')
while i >= 0:
- nextdir = path[:i]
- nextrest = path[i+1:]
+ nextdir = rest[:i]
+ nextrest = rest[i+1:]
scriptdir = self.translate_path(nextdir)
if os.path.isdir(scriptdir):
dir, rest = nextdir, nextrest
- i = path.find('/', len(dir) + 1)
+ i = rest.find('/')
else:
break