-
Notifications
You must be signed in to change notification settings - Fork 203
Closed as not planned
Description
- I have looked for existing issues (including closed) about this
Feature Request
Motivation
Currently ServeDir assumes that the files are served from /, which breaks trailing slash redirects in some configurations like a reverse proxy that redirects /somePath/* to the ServeDir server or a scenario where axum::Router::nest_service
is used.
Proposal
Allow this to be configured, see #486
Alternatives
NormalizePathLayer
doesn't work, since it removes the trailing slash and hence always triggers the TSR. Whether to perform the redirect depends on the files served (whether the requested path leads to a file or directory) so it seems reasonable to implement this in ServeDir
.
A similar argument applies to axum_extra
s function route_with_tsr
Metadata
Metadata
Assignees
Labels
No labels