Skip to content

Commit

Permalink
Remove slash in the path on root request
Browse files Browse the repository at this point in the history
  • Loading branch information
gemcoder21 committed Feb 18, 2025
1 parent edc2671 commit aa42454
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/request_url.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,14 @@ impl RequestUrl {
url_override: HashMap<String, Url>,
original_uri: &Uri,
) -> RequestUrl {
let uri = url.url + original_uri.to_string().as_str();
let path = if original_uri.path() == "/" {
String::new()
} else {
original_uri.to_string()
};
let uri = url.url + &path;
let uri = uri.parse::<hyper::Uri>().expect("invalid url");

for (path, endpoint) in url_override.clone() {
if uri.path() == path {
let uri = Uri::from_str(&endpoint.url.clone().as_str()).unwrap();
Expand Down

0 comments on commit aa42454

Please sign in to comment.