From 0e6e60d35a20d3c5e691f01e7f9372a390c18dea Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Wed, 8 Dec 2021 17:36:01 +0100 Subject: [PATCH] better split --- src/proxy_config.rs | 7 +++++-- 1 file 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), };