restore df7adaf0e0 ← after fixing mount-point; fix query() parsing

This commit is contained in:
Igor Galić 2019-08-20 15:21:01 +02:00
parent f395c1046c
commit d242e6df11
No known key found for this signature in database
GPG Key ID: ACFEFF7F6A123A86

View File

@ -390,10 +390,13 @@ macro_rules! url {
$($custom_args = $custom_args,)*
);
let path = origin
.segments() // first segment is /custom_domain,
.skip(2)// second is <domain>, drop both
.segments()
.skip(1)// skip is <custom_domain> part
.map(|seg| format!("/{}", seg)).collect::<String>();
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 {
$(