From 39d1a097044c8262771eca2d0fb49cf6743bcf17 Mon Sep 17 00:00:00 2001 From: Jeremy Lin Date: Sat, 30 May 2020 01:06:40 -0700 Subject: [PATCH] Avoid double-slashes in the admin URL --- src/api/admin.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/api/admin.rs b/src/api/admin.rs index 3eeffe05..bd9bf3e9 100644 --- a/src/api/admin.rs +++ b/src/api/admin.rs @@ -63,7 +63,9 @@ fn admin_path() -> String { /// Used for `Location` response headers, which must specify an absolute URI /// (see https://tools.ietf.org/html/rfc2616#section-14.30). fn admin_url() -> String { - format!("{}{}", CONFIG.domain(), ADMIN_PATH) + // Don't use CONFIG.domain() directly, since the user may want to keep a + // trailing slash there, particularly when running under a subpath. + format!("{}{}{}", CONFIG.domain_origin(), CONFIG.domain_path(), ADMIN_PATH) } #[get("/", rank = 2)]