#18 Directory Listing for Static Files

Open
opened 2 months ago by hz · 1 comments
hz commented 2 months ago

We should add a flag to enable directory listings within __STATIC__ directories (i.e., navigating to a directory should show a listing of the files contained therein if a particular flag is set).

We should add a flag to enable directory listings within `__STATIC__` directories (i.e., navigating to a directory should show a listing of the files contained therein if a particular flag is set).
hz added this to the 14.0.0 milestone 2 months ago
hz added the
enhancement
label 2 months ago
hz self-assigned this 2 months ago
hz removed their assignment 2 months ago
hz added the
beginner friendly
label 2 months ago
hz commented 2 months ago
Owner

I think the right entry point for this change is the main function in dispatch.py. Right now, things short circuit in the case of requesting a static file. I think we want to keep that short-circuiting in place but only do that in the case where the URL actually represents a static file on disk.

Then, farther down the function (after we’ve run the preload.py files), if the resource being requested represents a static directory, we can check to see if some option (yet to be defined) has been set, and, if it has, generate a page to list the files in the directory.

We’ll need to make sure this properly handles not only the base __STATIC__ directory, but also subdirectories.

I think the right entry point for this change is the `main` function in `dispatch.py`. Right now, things short circuit in the case of requesting a static file. I think we want to keep that short-circuiting in place but only do that in the case where the URL actually represents a static _file_ on disk. Then, farther down the function (after we've run the `preload.py` files), if the resource being requested represents a static _directory_, we can check to see if some option (yet to be defined) has been set, and, if it has, generate a page to list the files in the directory. We'll need to make sure this properly handles not only the base `__STATIC__` directory, but also subdirectories.
hz modified the milestone from 14.0.0 to next_release 1 month ago
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
Cancel
Save
There is no content yet.