diff options
author | zhoupeiheng <zhoupeiheng@bytedance.com> | 2022-07-28 08:36:20 +0000 |
---|---|---|
committer | zhoupeiheng <zhoupeiheng@bytedance.com> | 2022-07-28 08:36:20 +0000 |
commit | ff3bab81e9dc515e687c9bfea5dea0a719297131 (patch) | |
tree | ecb6e49450ef0321d305626f6ed47018a180c609 /src | |
parent | test: check_static_file_route_pattern (diff) | |
download | miniserve-ff3bab81e9dc515e687c9bfea5dea0a719297131.tar.gz miniserve-ff3bab81e9dc515e687c9bfea5dea0a719297131.zip |
Apply suggestions from code review
Diffstat (limited to 'src')
-rw-r--r-- | src/config.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs index d3aa845..ec7ec66 100644 --- a/src/config.rs +++ b/src/config.rs @@ -151,6 +151,9 @@ impl MiniserveConfig { // Generate some random routes for the favicon and css so that they are very unlikely to conflict with // real files. + // If --random-route is enabled , in order to not leak the random generated route, we must not use it + // as static files prefix. + // Otherwise, we should apply route_prefix to static files. let (favicon_route, css_route) = if args.random_route { ( format!("/{}", nanoid::nanoid!(10, &ROUTE_ALPHABET)), |