]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-100474: Fix handling of dirs named index.html in http.server (GH-100475)
authorJames Frost <git@frost.cx>
Sat, 24 Dec 2022 18:28:59 +0000 (18:28 +0000)
committerGitHub <noreply@github.com>
Sat, 24 Dec 2022 18:28:59 +0000 (10:28 -0800)
commit46e6a28308def2c3a71c679a6fa4ed7d520802b9
treeb2b2c299b224765262b01e8bf280e5f692c95599
parent00afa5066bd45348ed82a38d3442763b2ed1a068
gh-100474: Fix handling of dirs named index.html in http.server (GH-100475)

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.

I have also added a test case for this situation.

Automerge-Triggered-By: GH:merwok
Lib/http/server.py
Lib/test/test_httpservers.py
Misc/NEWS.d/next/Library/2022-12-23-21-02-43.gh-issue-100474.gppA4U.rst [new file with mode: 0644]