8000 gh-100474: Fix handling of dirs named index.html in http.server by Fraetor · Pull Request #100475 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content
/ cpython Public

gh-100474: Fix handling of dirs named index.html in http.server #100475

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Dec 24, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
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.
  • Loading branch information
Fraetor committed Dec 23, 2022
commit 43a1a0dde57cb7e02974dc8b991ea2f7efe2af16
2 changes: 1 addition & 1 deletion Lib/http/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ def send_head(self):
return None
for index in self.index_pages:
index = os.path.join(path, index)
if os.path.exists(index):
if os.path.isfile(index):
path = index
break
else:
Expand Down
0