Preserve FTP password and filename whitespace

This commit is contained in:
Danny Kim
2026-09-30 15:24:28 +09:00
parent d412eb1d13
commit e4f427fa9d
5 changed files with 76 additions and 4 deletions
+7 -2
View File
@@ -64,7 +64,9 @@ fn names_a_conflict(text: &str) -> bool {
.collect();
words.contains(&"exists")
|| words.contains(&"nonempty")
|| words.windows(2).any(|pair| matches!(pair, ["not" | "non", "empty"]))
|| words
.windows(2)
.any(|pair| matches!(pair, ["not" | "non", "empty"]))
}
/// What the first reply to a transfer command means. A transfer answers with
@@ -255,7 +257,10 @@ mod tests {
));
// The same two conditions as other servers phrase them.
assert!(matches!(
refusal(550, "550 Cannot create a file when that file already exists."),
refusal(
550,
"550 Cannot create a file when that file already exists."
),
Err(ErrorCode::Conflict)
));
assert!(matches!(