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

Fix possible panic when doing trailing slash redirect #1124

Merged
merged 4 commits into from Jun 28, 2022

Conversation

davidpdrsn
Copy link
Member

Fixes #1122

It panicked because we hit this https://github.com/hyperium/http/blob/master/src/uri/mod.rs#L248-L250 and did an unwrap. So rather than panicking we send the request to the fallback. We cannot issue a redirect since we couldn't add the path so guess there isn't much else we can do.

axum/src/routing/mod.rs Outdated Show resolved Hide resolved
Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
@davidpdrsn davidpdrsn requested a review from jplatte June 28, 2022 11:06
@davidpdrsn davidpdrsn merged commit a8d0ce8 into main Jun 28, 2022
@davidpdrsn davidpdrsn deleted the fix-replace-path-panic branch June 28, 2022 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panicking inside "replace_trailing_slash" function
2 participants