mirror of
https://github.com/actix/actix-web.git
synced 2024-06-13 10:49:26 +00:00
Update named.rs
This commit is contained in:
parent
46dde69d50
commit
15bfcebf18
|
@ -139,8 +139,12 @@ impl NamedFile {
|
|||
_ => DispositionType::Attachment,
|
||||
};
|
||||
|
||||
// Replace newlines in filenames which could occur on some filesystems.
|
||||
let filename_s = filename.replace('\n', "%0A");
|
||||
// Replace newlines and other line breaks in filenames which could occur on some filesystems.
|
||||
let filename_s = filename
|
||||
.replace('\n', "%0A")
|
||||
.replace('\x0B', "%0B") // \v vertical tab
|
||||
.replace('\x0C', "%0C") // \f form feed
|
||||
.replace('\r', "%0D");
|
||||
let mut parameters = vec![DispositionParam::Filename(filename_s)];
|
||||
|
||||
if !filename.is_ascii() {
|
||||
|
|
Loading…
Reference in a new issue