Fix urlencoding when jumping to unknown ID
This commit is contained in:
parent
d4b0290bd4
commit
35c287e082
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -1200,6 +1200,7 @@ dependencies = [
|
||||||
"mime",
|
"mime",
|
||||||
"printpdf",
|
"printpdf",
|
||||||
"serde",
|
"serde",
|
||||||
|
"serde_urlencoded",
|
||||||
"serde_variant",
|
"serde_variant",
|
||||||
"sqlx",
|
"sqlx",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
|
|
|
@ -25,6 +25,7 @@ maud = { version = "0.26.0", features = ["actix-web"] }
|
||||||
mime = "0.3.17"
|
mime = "0.3.17"
|
||||||
printpdf = "0.7.0"
|
printpdf = "0.7.0"
|
||||||
serde = { version = "1.0.203", features = ["serde_derive"] }
|
serde = { version = "1.0.203", features = ["serde_derive"] }
|
||||||
|
serde_urlencoded = "0.7.1"
|
||||||
serde_variant = "0.1.3"
|
serde_variant = "0.1.3"
|
||||||
sqlx = { version = "0.7.4", features = ["runtime-tokio", "postgres", "uuid", "time"] }
|
sqlx = { version = "0.7.4", features = ["runtime-tokio", "postgres", "uuid", "time"] }
|
||||||
thiserror = "1.0.61"
|
thiserror = "1.0.61"
|
||||||
|
|
|
@ -75,6 +75,10 @@ async fn jump(
|
||||||
}) {
|
}) {
|
||||||
Ok(web::Redirect::to(format!("/{prefix}/{id}")).see_other())
|
Ok(web::Redirect::to(format!("/{prefix}/{id}")).see_other())
|
||||||
} else {
|
} else {
|
||||||
Ok(web::Redirect::to(format!("/items/add?name={id}")).see_other())
|
Ok(web::Redirect::to(format!(
|
||||||
|
"/items/add?{}",
|
||||||
|
serde_urlencoded::to_string([("name", &id)])?
|
||||||
|
))
|
||||||
|
.see_other())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue