fix/change: remove ? prefix from search in browser (matching server behavior) - closes #1071 (#1077)

This commit is contained in:
Greg Johnston 2023-05-21 22:06:38 -04:00 committed by GitHub
parent a9ed8461d1
commit 91e0fcdc1b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -42,7 +42,11 @@ impl TryFrom<&str> for Url {
Ok(Self { Ok(Self {
origin: url.origin(), origin: url.origin(),
pathname: url.pathname(), pathname: url.pathname(),
search: url.search(), search: url
.search()
.strip_prefix('?')
.map(String::from)
.unwrap_or_default(),
search_params: ParamsMap( search_params: ParamsMap(
try_iter(&url.search_params()) try_iter(&url.search_params())
.map_js_error()? .map_js_error()?