From eb10cc960655973f918c0544151aaa30d0187d56 Mon Sep 17 00:00:00 2001 From: ghosttk Date: Mon, 4 Jul 2022 20:32:44 +0800 Subject: [PATCH] vweb: fix '/' in scan_static_directory (#14940) --- vlib/vweb/vweb.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vlib/vweb/vweb.v b/vlib/vweb/vweb.v index 102a92266e..0e55a6db38 100644 --- a/vlib/vweb/vweb.v +++ b/vlib/vweb/vweb.v @@ -613,7 +613,7 @@ fn (mut ctx Context) scan_static_directory(directory_path string, mount_path str for file in files { full_path := os.join_path(directory_path, file) if os.is_dir(full_path) { - ctx.scan_static_directory(full_path, mount_path + '/' + file) + ctx.scan_static_directory(full_path, mount_path.trim_right('/') + '/' + file) } else if file.contains('.') && !file.starts_with('.') && !file.ends_with('.') { ext := os.file_ext(file) // Rudimentary guard against adding files not in mime_types.