fix: serve files with names containing newline char (#328)

This commit is contained in:
sigoden
2023-12-23 15:40:41 +08:00
committed by GitHub
parent 77f86a4c60
commit 006e03ed30
3 changed files with 31 additions and 2 deletions

View File

@@ -16,7 +16,14 @@ pub const BIN_FILE: &str = "😀.bin";
/// File names for testing purpose
#[allow(dead_code)]
pub static FILES: &[&str] = &["test.txt", "test.html", "index.html", BIN_FILE];
pub static FILES: &[&str] = &[
"test.txt",
"test.html",
"index.html",
#[cfg(not(target_os = "windows"))]
"file\n1.txt",
BIN_FILE,
];
/// Directory names for testing directory don't exist
#[allow(dead_code)]