diff options
author | Alex Auvolat <alex@adnab.me> | 2021-12-08 17:36:01 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2021-12-08 17:36:01 +0100 |
commit | 0e6e60d35a20d3c5e691f01e7f9372a390c18dea (patch) | |
tree | b2ca2336b4837c15455092854f51309b2fd2c4b3 | |
parent | 8d47bef9d45a767fcc166d26b75fc51937116bcd (diff) | |
download | tricot-0e6e60d35a20d3c5e691f01e7f9372a390c18dea.tar.gz tricot-0e6e60d35a20d3c5e691f01e7f9372a390c18dea.zip |
better split
-rw-r--r-- | src/proxy_config.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/proxy_config.rs b/src/proxy_config.rs index 29493b2..009ca07 100644 --- a/src/proxy_config.rs +++ b/src/proxy_config.rs @@ -98,8 +98,11 @@ fn parse_tricot_tag( return None; } - let (host, path_prefix) = match splits[1].split_once('/') { - Some((h, p)) => (h, Some(format!("/{}", p))), + let (host, path_prefix) = match splits[1].find('/') { + Some(i) => { + let (host, pp) = splits[1].split_at(i); + (host, Some(pp.to_string())) + }, None => (splits[1], None), }; |