Browse Source
Merge pull request #1010 from jjlin/admin-url
Avoid double-slashes in the admin URL
pull/1012/head
Daniel García
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
3 additions and
1 deletions
-
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)] |
|
|
|