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

Panicking inside "replace_trailing_slash" function #1122

Closed
shamblesides opened this issue Jun 26, 2022 · 5 comments · Fixed by #1124
Closed

Panicking inside "replace_trailing_slash" function #1122

shamblesides opened this issue Jun 26, 2022 · 5 comments · Fixed by #1124
Labels
A-axum C-bug Category: This is a bug.

Comments

@shamblesides
Copy link

shamblesides commented Jun 26, 2022

Bug Report

Version

0.5.7

Platform

Linux prod 5.10.0-9-amd64 #1 SMP Debian 5.10.70-1 (2021-09-30) x86_64 GNU/Linux

Description

Axum is panicking here: https://github.com/tokio-rs/axum/blob/main/axum/src/routing/mod.rs#L532

panicked at 'called `Result::unwrap()` on an `Err` value: InvalidUriParts(InvalidUri(SchemeMissing))
@shamblesides shamblesides changed the title Panicking in prod inside "replace_trailing_slash" function Panicking inside "replace_trailing_slash" function Jun 26, 2022
@davidpdrsn davidpdrsn added C-bug Category: This is a bug. A-axum labels Jun 26, 2022
@davidpdrsn
Copy link
Member

I'm curious whether this is a bug in the http crate. I've asked in Discord.

davidpdrsn added a commit that referenced this issue Jun 28, 2022
* Fix possible panic when doing trailing slash redirect

Fixes #1122

* changelog link

* Update axum/src/routing/mod.rs

Co-authored-by: Jonas Platte <jplatte+git@posteo.de>

Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
@niklasf
Copy link

niklasf commented Jun 28, 2022

Was this bringing down the server, or was unwinding caught?

@davidpdrsn
Copy link
Member

davidpdrsn commented Jun 28, 2022

It wouldn't bring down the server. Just close the connection without sending a response, because hyper (or maybe tokio) catches the panic.

The fix has been released in 0.5.10 🎉

@shamblesides
Copy link
Author

FYI this was indeed bringing down my server, but I guess this is probably because I was aborting upon panicking

@davidpdrsn
Copy link
Member

Yes. If you do that there is nothing tokio/hyper can do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-axum C-bug Category: This is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants