mirror of https://github.com/fafhrd91/actix-web
fix changelog
This commit is contained in:
parent
d2ea78fd13
commit
6a075f69d5
|
@ -2,10 +2,11 @@
|
||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
- Fix handling of special characters in filenames.
|
||||||
|
|
||||||
## 0.6.4
|
## 0.6.4
|
||||||
|
|
||||||
- Fix handling of linebreaks in filenames. [#3237]
|
- Fix handling of newlines in filenames.
|
||||||
- Fix handling of newlines in filenames. [#3235]
|
|
||||||
- Minimum supported Rust version (MSRV) is now 1.68 due to transitive `time` dependency.
|
- Minimum supported Rust version (MSRV) is now 1.68 due to transitive `time` dependency.
|
||||||
|
|
||||||
## 0.6.3
|
## 0.6.3
|
||||||
|
|
|
@ -569,7 +569,7 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[actix_rt::test]
|
#[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
|
// 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.
|
// Windows can't even checkout this repository.
|
||||||
let temp_dir = tempfile::tempdir().unwrap();
|
let temp_dir = tempfile::tempdir().unwrap();
|
||||||
|
|
|
@ -139,12 +139,12 @@ impl NamedFile {
|
||||||
_ => DispositionType::Attachment,
|
_ => 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
|
let filename_s = filename
|
||||||
.replace('\n', "%0A")
|
.replace('\n', "%0A") // \n line break
|
||||||
.replace('\x0B', "%0B") // \v vertical tab
|
.replace('\x0B', "%0B") // \v vertical tab
|
||||||
.replace('\x0C', "%0C") // \f form feed
|
.replace('\x0C', "%0C") // \f form feed
|
||||||
.replace('\r', "%0D");
|
.replace('\r', "%0D"); // \r carriage return
|
||||||
let mut parameters = vec![DispositionParam::Filename(filename_s)];
|
let mut parameters = vec![DispositionParam::Filename(filename_s)];
|
||||||
|
|
||||||
if !filename.is_ascii() {
|
if !filename.is_ascii() {
|
||||||
|
|
Loading…
Reference in New Issue