-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Add `show_index` flag to StaticRoute Related: #921 * Accessing static dir, should return 403 by default If we want to access a static file dir, it should return `Forbidden (403)` by default. Related: #921 * WIP: if allowed - return directory's index, otherwise - 403 XXX: need for a response to return proper html Related: #921 * Return directory index list if we allow to show it Also I now return in place, instead of creating variable and returning later, I am not a fan of returning somewehere inside a method, though if we tried to return `ret` at the end as before, but I guess it's the most clean pattern to do this. This is because we have to conditional blocks, either of which can return from the method. If first condtitonal creates `ret` variable, later conditional may just raise `HTTPNotFound` which we do not want. Though, I do not want to check that `ret` is populated either. Thus return in place. Related: #921 * Test if correct statuses are returned if we allow acces index or not Related: #921 * Prettier directory output - Better method name - More human readable output (newlines) - Title is shown as relative path to static directory and not as posix path - Show directories with slash at the end of the name * Remove unnecessary comment * Update docs And fix a minor typo * Check of html content is added for the response page with a directory index Related: #921 * Test of accessing non-existing static resource added Related: #921 * 403 Forbidden returned if the permission error occurred on listing requested folder Related: #921 * show_index parameter usage of app.router.add_static method documented Related: #921 * Import order fixed Related: #921 * Make directory index sorted so stable for tests Related: #921 * Improve tests coverage Related: #921 * Improve tests coverage Related: #921
- Loading branch information
Showing
4 changed files
with
199 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters