Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make normalize_path configurable to allow for trailing slashes #530

Open
alper opened this issue Nov 13, 2024 · 1 comment
Open

Make normalize_path configurable to allow for trailing slashes #530

alper opened this issue Nov 13, 2024 · 1 comment

Comments

@alper
Copy link

alper commented Nov 13, 2024

I think paths should be normalised to end with a slash.

See how (and why) Django does this:

Since tower-http/src/normalize_path.rs has already gone in the other direction, I guess the best way forward would be to make it configurable so that those who prefer trailing slashes can get them?

I'll happily make the change.

@jplatte
Copy link
Collaborator

jplatte commented Jan 29, 2025

The existing constructor is named trim_trailing_slash (rather than new) to allow for other constructors / normalization styles to be added down the line. So feel free to send a PR. I think I had a short discussion with somebody around what to name the "add trailing slash if missing" style before, but I don't know where that was. If it's not in another issue or GH discussion, it's probably going to be impossible to find. Settling the exact name can happen on an otherwise finished PR, IMHO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants