From 14345cf5b6d570611f6bc64ce23af274478ac834 Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Wed, 30 Mar 2022 18:35:21 +0200 Subject: Do not use the route for the favicon and stylesheet In order to no leak the random generated route, we must not use it as prefix in the 404 error page. Indeed we can just use a top-level path for these files. --- src/config.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config.rs b/src/config.rs index ef3d1de..29e4c5c 100644 --- a/src/config.rs +++ b/src/config.rs @@ -145,8 +145,8 @@ impl MiniserveConfig { // Generate some random routes for the favicon and css so that they are very unlikely to conflict with // real files. - let favicon_route = format!("{}/{}", route_prefix, nanoid::nanoid!(10, &ROUTE_ALPHABET)); - let css_route = format!("{}/{}", route_prefix, nanoid::nanoid!(10, &ROUTE_ALPHABET)); + let favicon_route = format!("/{}", nanoid::nanoid!(10, &ROUTE_ALPHABET)); + let css_route = format!("/{}", nanoid::nanoid!(10, &ROUTE_ALPHABET)); let default_color_scheme = args.color_scheme; let default_color_scheme_dark = args.color_scheme_dark; -- cgit v1.2.3