1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

vweb: remove the extra '/' in scan_static_directory (#14806)

This commit is contained in:
ghosttk 2022-06-21 20:13:09 +08:00 committed by GitHub
parent 9f5e442dab
commit 8172fecb51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -613,7 +613,7 @@ fn (mut ctx Context) scan_static_directory(directory_path string, mount_path str
for file in files { for file in files {
full_path := os.join_path(directory_path, file) full_path := os.join_path(directory_path, file)
if os.is_dir(full_path) { if os.is_dir(full_path) {
ctx.scan_static_directory(full_path, mount_path + '/' + file) ctx.scan_static_directory(full_path, mount_path + file)
} else if file.contains('.') && !file.starts_with('.') && !file.ends_with('.') { } else if file.contains('.') && !file.starts_with('.') && !file.ends_with('.') {
ext := os.file_ext(file) ext := os.file_ext(file)
// Rudimentary guard against adding files not in mime_types. // Rudimentary guard against adding files not in mime_types.