From d242e6df1156982d0f9284b2ce3b7b6691c64738 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Gali=C4=87?= Date: Tue, 20 Aug 2019 15:21:01 +0200 Subject: [PATCH] =?UTF-8?q?restore=20df7adaf0e067802daf3e83935cf9140fb15ca?= =?UTF-8?q?17b=20=E2=86=90=20after=20fixing=20mount-point;=20fix=20query()?= =?UTF-8?q?=20parsing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/template_utils.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/template_utils.rs b/src/template_utils.rs index db935ab6..5f0e61f2 100644 --- a/src/template_utils.rs +++ b/src/template_utils.rs @@ -390,10 +390,13 @@ macro_rules! url { $($custom_args = $custom_args,)* ); let path = origin - .segments() // first segment is /custom_domain, - .skip(2)// second is , drop both + .segments() + .skip(1)// skip is part .map(|seg| format!("/{}", seg)).collect::(); - let query = origin.query().map(|q| format!("?{}", q)).unwrap_or_default(); + let query = origin.query() + .filter(|q| !q.is_empty()) + .map(|q| format!("?{}", q)) + .unwrap_or_default(); format!("https://{}{}{}", &domain, path, query) } else { $(