[3.11] gh-100474: Fix handling of dirs named index.html in http.server (GH-100505)

Co-authored-by: James Frost <git@frost.cx>
This commit is contained in:
Miss Islington (bot) 2022-12-24 12:28:41 -08:00 committed by GitHub
parent 80013d78e0
commit 714a93f638
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

View file

@ -708,7 +708,7 @@ class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
return None
for index in "index.html", "index.htm":
index = os.path.join(path, index)
if os.path.exists(index):
if os.path.isfile(index):
path = index
break
else: