Skip to content

Commit a246be8

Browse files
committed
Fix handling of dirs named index.html in http.server
If you had a directory called index.html or index.htm within a directory, it would cause http.server to return a 404 Not Found error instead of the directory listing. This came about due to not checking that the index was a regular file.
1 parent c3c7848 commit a246be8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/http/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ def send_head(self):
711711
return None
712712
for index in self.index_pages:
713713
index = os.path.join(path, index)
714-
if os.path.exists(index):
714+
if os.path.isfile(index):
715715
path = index
716716
break
717717
else:

0 commit comments

Comments
 (0)