You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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_extras function route_with_tsr
The text was updated successfully, but these errors were encountered:
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 inServeDir
.A similar argument applies to
axum_extra
s functionroute_with_tsr
The text was updated successfully, but these errors were encountered: