This patch makes the the Rack::Static code a little more efficient and readable. At the same time it adds support for existent directory index support --instead of just checking for a trailing /, failing that it will check to see if the the path is an actual directory on disk. This is indispensable in some use cases where a trailing slash can not be insured, but the directories index file still needs to be served.
If necessary I can add a new configuration option to conditionally support this new directory behavior, but I did not do so presently b/c I suspect it would be a YAGNI.
Refactor Static class and improve dir index support.
This pull request fails (merged 1fe6ef0 into edc8b92).
Doesn't look like the failing test is related to this.
This is going to take me quite some time to review, and as such may not make it into the most immediate release.
:-( Maybe it can be a different class at first? That would allow people to kick its tires, so to speak, without upsetting current Static based code.
Could we get some tests for this?
I would also like to see this tested and merged. I have a unique need to serve up directories of mirrored content and Rack::Static's :index option is only used for handling /.
Also, I'm surprised that Rack::File and Rack::Directory don't already support index lookups.
This needs rebasing, and it needs tests. Closing for now. Please reopen when we have tests.