Fix missing query string on #[get] server functions (#4827)
This commit is contained in:
1 parent
281f68faf5
commit
5786c9396f
1 file changed
+13
-2
@@ -143,8 +143,19 @@ impl ClientRequest {
|
|||||||
|
|
||||||
#[cfg(feature = "web")]
|
#[cfg(feature = "web")]
|
||||||
pub fn new_gloo_request(&self) -> gloo_net::http::RequestBuilder {
|
pub fn new_gloo_request(&self) -> gloo_net::http::RequestBuilder {
|
||||||
let mut builder =
|
let mut builder = gloo_net::http::RequestBuilder::new(
|
||||||
gloo_net::http::RequestBuilder::new(self.url.path()).method(self.method.clone());
|
format!(
|
||||||
|
"{path}{query_string}",
|
||||||
|
path = self.url.path(),
|
||||||
|
query_string = self
|
||||||
|
.url
|
||||||
|
.query()
|
||||||
|
.map(|query| format!("?{query}"))
|
||||||
|
.unwrap_or_default()
|
||||||
|
)
|
||||||
|
.as_str(),
|
||||||
|
)
|
||||||
|
.method(self.method.clone());
|
||||||
|
|
||||||
for (key, value) in self.headers.iter() {
|
for (key, value) in self.headers.iter() {
|
||||||
let value = match value.to_str() {
|
let value = match value.to_str() {
|
||||||
|
|||||||
Reference in new issue
Block a user