diff --git a/src/proxy.rs b/src/proxy.rs index 53a7605..a9fcf3e 100644 --- a/src/proxy.rs +++ b/src/proxy.rs @@ -94,12 +94,18 @@ impl Handler for ProxyServer // We first extract all URL segments starting from the mountpoint let segments: PathBuf = req.segments(0..).unwrap(); + let query_part = if let Some(query) = req.uri().query() { + format!("?{}", query) + }else{ + String::from("") + }; + let url = format!( - "{}{}/{}?{}", + "{}{}/{}{}", self.root, self.prefix.to_str().unwrap(), segments.to_str().unwrap(), - req.uri().query().unwrap() + query_part ); // And finally, the data