HTTP::StaticFileHandler
returns 302 Found
for directory requests missing trailing slash even when directory_listing: false
#15390
Labels
When
HTTP::StaticFileHandler
is initialized withdirectory_listing: false
, the handler behaves as expected (returning a404 Not Found
) when requesting a directory with the trailing slash/foo/
. But, if the trailing slash is missing/foo
, it redirects to/foo/
with a302 Found
response.In production this can lead to an infinite redirect loop when the Crystal application is behind Nginx and Nginx is configured to remove all trailing slashes.
And I guess this can also be considered as a security risk since it is possible to check if a directory exists on the server.
The text was updated successfully, but these errors were encountered: