From 46dde69d502d6800fadec2bf1401586b6090ee11 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Sat, 6 Jan 2024 10:19:15 +0000 Subject: [PATCH] chore(actix-files): prepare release 0.6.4 --- actix-files/CHANGES.md | 4 +++- actix-files/Cargo.toml | 2 +- actix-files/README.md | 4 ++-- actix-files/src/lib.rs | 13 +++++++------ 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/actix-files/CHANGES.md b/actix-files/CHANGES.md index 81e361a2120..ac0fbfedc19 100644 --- a/actix-files/CHANGES.md +++ b/actix-files/CHANGES.md @@ -2,8 +2,10 @@ ## Unreleased +## 0.6.4 + +- Fix handling of newlines in filenames. - Minimum supported Rust version (MSRV) is now 1.68 due to transitive `time` dependency. -- Properly handle newlines in filenames. [#3235] ## 0.6.3 diff --git a/actix-files/Cargo.toml b/actix-files/Cargo.toml index efecb088933..b7a2725157a 100644 --- a/actix-files/Cargo.toml +++ b/actix-files/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "actix-files" -version = "0.6.3" +version = "0.6.4" authors = [ "Nikolay Kim ", "Rob Ede ", diff --git a/actix-files/README.md b/actix-files/README.md index 3e656c4319b..d8d9e4f1ff6 100644 --- a/actix-files/README.md +++ b/actix-files/README.md @@ -3,11 +3,11 @@ > Static file serving for Actix Web [![crates.io](https://img.shields.io/crates/v/actix-files?label=latest)](https://crates.io/crates/actix-files) -[![Documentation](https://docs.rs/actix-files/badge.svg?version=0.6.3)](https://docs.rs/actix-files/0.6.3) +[![Documentation](https://docs.rs/actix-files/badge.svg?version=0.6.4)](https://docs.rs/actix-files/0.6.4) ![Version](https://img.shields.io/badge/rustc-1.68+-ab6000.svg) ![License](https://img.shields.io/crates/l/actix-files.svg)
-[![dependency status](https://deps.rs/crate/actix-files/0.6.3/status.svg)](https://deps.rs/crate/actix-files/0.6.3) +[![dependency status](https://deps.rs/crate/actix-files/0.6.4/status.svg)](https://deps.rs/crate/actix-files/0.6.4) [![Download](https://img.shields.io/crates/d/actix-files.svg)](https://crates.io/crates/actix-files) [![Chat on Discord](https://img.shields.io/discord/771444961383153695?label=chat&logo=discord)](https://discord.gg/NWpN5mmg3x) diff --git a/actix-files/src/lib.rs b/actix-files/src/lib.rs index 87914c1cef9..8ceb59bef77 100644 --- a/actix-files/src/lib.rs +++ b/actix-files/src/lib.rs @@ -572,11 +572,12 @@ mod tests { async fn test_static_files_with_newlines() { // 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 tmpdir = tempfile::tempdir().unwrap(); - let file_with_newlines = tmpdir.path().join("test\nnewline.text"); + let temp_dir = tempfile::tempdir().unwrap(); + let file_with_newlines = temp_dir.path().join("test\nnewline.text"); fs::write(&file_with_newlines, "Look at my newlines").unwrap(); + let srv = test::init_service( - App::new().service(Files::new("", tmpdir.path()).index_file("Cargo.toml")), + App::new().service(Files::new("/", temp_dir.path()).index_file("Cargo.toml")), ) .await; let request = TestRequest::get().uri("/test%0Anewline.text").to_request(); @@ -860,7 +861,7 @@ mod tests { #[actix_rt::test] async fn test_percent_encoding_2() { - let tmpdir = tempfile::tempdir().unwrap(); + let temp_dir = tempfile::tempdir().unwrap(); let filename = match cfg!(unix) { true => "ض:?#[]{}<>()@!$&'`|*+,;= %20\n.test", false => "ض#[]{}()@!$&'`+,;= %20.test", @@ -872,9 +873,9 @@ mod tests { write!(&mut buf, "%{:02X}", c).unwrap(); buf }); - std::fs::File::create(tmpdir.path().join(filename)).unwrap(); + std::fs::File::create(temp_dir.path().join(filename)).unwrap(); - let srv = test::init_service(App::new().service(Files::new("", tmpdir.path()))).await; + let srv = test::init_service(App::new().service(Files::new("/", temp_dir.path()))).await; let req = TestRequest::get() .uri(&format!("/{}", filename_encoded))