1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-06-12 10:19:36 +00:00

fix changelog

This commit is contained in:
Rob Ede 2024-01-10 03:53:25 +00:00
parent d2ea78fd13
commit 6a075f69d5
No known key found for this signature in database
GPG key ID: 97C636207D3EF933
3 changed files with 7 additions and 6 deletions

View file

@ -2,10 +2,11 @@
## Unreleased
- Fix handling of special characters in filenames.
## 0.6.4
- Fix handling of linebreaks in filenames. [#3237]
- Fix handling of newlines in filenames. [#3235]
- Fix handling of newlines in filenames.
- Minimum supported Rust version (MSRV) is now 1.68 due to transitive `time` dependency.
## 0.6.3

View file

@ -569,7 +569,7 @@ mod tests {
}
#[actix_rt::test]
async fn test_static_files_with_newlines() {
async fn test_static_files_with_special_characters() {
// Create the file we want to test against ad-hoc. We can't check it in as otherwise
// Windows can't even checkout this repository.
let temp_dir = tempfile::tempdir().unwrap();

View file

@ -139,12 +139,12 @@ impl NamedFile {
_ => DispositionType::Attachment,
};
// Replace newlines and other line breaks in filenames which could occur on some filesystems.
// replace special characters in filenames which could occur on some filesystems
let filename_s = filename
.replace('\n', "%0A")
.replace('\n', "%0A") // \n line break
.replace('\x0B', "%0B") // \v vertical tab
.replace('\x0C', "%0C") // \f form feed
.replace('\r', "%0D");
.replace('\r', "%0D"); // \r carriage return
let mut parameters = vec![DispositionParam::Filename(filename_s)];
if !filename.is_ascii() {