Provide default for empty PathAndQuery (Sentry ID c09f58adf5...)

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2025-11-30 12:35:04 +00:00
parent 74f8cd3708
commit 50bfb0fe5e
2 changed files with 8 additions and 6 deletions

View File

@@ -8,6 +8,7 @@ use axum_client_ip::SecureClientIpSource;
use http::{
HeaderValue, Method, StatusCode,
header::{self, HeaderName},
uri::PathAndQuery,
};
use tower::ServiceBuilder;
use tower_http::{
@@ -239,8 +240,8 @@ fn request_path_str<T>(request: &http::Request<T>) -> &str {
request
.uri()
.path_and_query()
.expect("all requests have a path")
.as_str()
.map(PathAndQuery::as_str)
.unwrap_or("/")
}
fn truncated_matched_path(path: &MatchedPath) -> &str {