Merge pull request #358 from mirichan/master

Fix query parsing
This commit is contained in:
Jon Kelley 2022-04-19 23:12:00 -04:00 committed by GitHub
commit 1f6c0593b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -51,7 +51,7 @@ impl UseRoute {
#[cfg(feature = "query")]
pub fn query<T: serde::de::DeserializeOwned>(&self) -> Option<T> {
let query = self.url().query()?;
serde_urlencoded::from_str(query.strip_prefix('?').unwrap_or("")).ok()
serde_urlencoded::from_str(query).ok()
}
/// Get the first query parameter given the parameter name.