New submission from Erik Paulson <[email protected]>:
In http.server and SimpleHTTPRequestHandler - the send_head function is
hard-coded to treat index.html and index.htm as files to return in a directory
- if neither of those files are present, it lists the directory.
It would be very nice to be able to specify other files to use as a directory
index, similar to the DirectoryIndex directive from Apache.
I think it'd be straight forward to add some kind of list you could set, just
like you can modify extensions_map to include other types of MIME types.
Would it be OK to just add a directory_index list with index.html and index.htm
on by default that people could do like
Handler.directory_index.append("index.htmlx") in their setup? Or would such an
API be better with some kind of helper?
----------
components: Library (Lib)
messages: 310468
nosy: epaulson
priority: normal
severity: normal
status: open
title: Add configurable DirectoryIndex to http.server
versions: Python 3.7
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue32628>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com