Skip to content

Commit 9e20b80

Browse files
Merge branch 'master' into headermap2
2 parents 7fb7274 + 891ab08 commit 9e20b80

File tree

30 files changed

+178
-93
lines changed

30 files changed

+178
-93
lines changed

.github/workflows/ci-post-merge.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ jobs:
4040
echo 'OPENSSL_DIR=C:\Program Files\OpenSSL' | Out-File -FilePath $env:GITHUB_ENV -Append
4141
4242
- name: Install Rust (${{ matrix.version.name }})
43-
uses: actions-rust-lang/setup-rust-toolchain@v1.6.0
43+
uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
4444
with:
4545
toolchain: ${{ matrix.version.version }}
4646

4747
- name: Install cargo-hack
48-
uses: taiki-e/install-action@v2.23.7
48+
uses: taiki-e/install-action@v2.25.9
4949
with:
5050
tool: cargo-hack
5151

@@ -82,10 +82,10 @@ jobs:
8282
- uses: actions/checkout@v4
8383

8484
- name: Install Rust
85-
uses: actions-rust-lang/setup-rust-toolchain@v1.6.0
85+
uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
8686

8787
- name: Install cargo-hack
88-
uses: taiki-e/install-action@v2.23.7
88+
uses: taiki-e/install-action@v2.25.9
8989
with:
9090
tool: cargo-hack
9191

@@ -103,10 +103,10 @@ jobs:
103103
- uses: actions/checkout@v4
104104

105105
- name: Install Rust
106-
uses: actions-rust-lang/setup-rust-toolchain@v1.6.0
106+
uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
107107

108108
- name: Install nextest
109-
uses: taiki-e/install-action@v2.23.7
109+
uses: taiki-e/install-action@v2.25.9
110110
with:
111111
tool: nextest
112112

.github/workflows/ci.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ jobs:
4545
echo 'OPENSSL_DIR=C:\Program Files\OpenSSL' | Out-File -FilePath $env:GITHUB_ENV -Append
4646
4747
- name: Install Rust (${{ matrix.version.name }})
48-
uses: actions-rust-lang/setup-rust-toolchain@v1.6.0
48+
uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
4949
with:
5050
toolchain: ${{ matrix.version.version }}
5151

5252
- name: Install cargo-hack
53-
uses: taiki-e/install-action@v2.23.7
53+
uses: taiki-e/install-action@v2.25.9
5454
with:
5555
tool: cargo-hack
5656

@@ -93,7 +93,7 @@ jobs:
9393
- uses: actions/checkout@v4
9494

9595
- name: Install Rust
96-
uses: actions-rust-lang/setup-rust-toolchain@v1.6.0
96+
uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
9797
with:
9898
toolchain: nightly
9999

@@ -109,7 +109,7 @@ jobs:
109109
- uses: actions/checkout@v4
110110

111111
- name: Install Rust (nightly)
112-
uses: actions-rust-lang/setup-rust-toolchain@v1.6.0
112+
uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
113113
with:
114114
toolchain: nightly
115115

.github/workflows/coverage.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ jobs:
1818
- uses: actions/checkout@v4
1919

2020
- name: Install Rust
21-
uses: actions-rust-lang/setup-rust-toolchain@v1.6.0
21+
uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
2222
with:
2323
components: llvm-tools-preview
2424

2525
- name: Install cargo-llvm-cov
26-
uses: taiki-e/install-action@v2.23.7
26+
uses: taiki-e/install-action@v2.25.9
2727
with:
2828
tool: cargo-llvm-cov
2929

.github/workflows/lint.yml

+15-9
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@ jobs:
1717
steps:
1818
- uses: actions/checkout@v4
1919

20-
- uses: actions-rust-lang/[email protected]
20+
- name: Install Rust (nightly)
21+
uses: actions-rust-lang/[email protected]
2122
with:
2223
toolchain: nightly
2324
components: rustfmt
2425

25-
- name: Check with rustfmt
26+
- name: Check with Rustfmt
2627
run: cargo fmt --all -- --check
2728

2829
clippy:
@@ -35,7 +36,7 @@ jobs:
3536
- uses: actions/checkout@v4
3637

3738
- name: Install Rust
38-
uses: actions-rust-lang/setup-rust-toolchain@v1.6.0
39+
uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
3940
with:
4041
components: clippy
4142

@@ -53,7 +54,8 @@ jobs:
5354
steps:
5455
- uses: actions/checkout@v4
5556

56-
- uses: actions-rust-lang/[email protected]
57+
- name: Install Rust (nightly)
58+
uses: actions-rust-lang/[email protected]
5759
with:
5860
toolchain: nightly
5961
components: rust-docs
@@ -66,21 +68,25 @@ jobs:
6668
public-api-diff:
6769
runs-on: ubuntu-latest
6870
steps:
69-
- uses: actions/checkout@v4
71+
- name: Checkout main branch
72+
uses: actions/checkout@v4
7073
with:
7174
ref: ${{ github.base_ref }}
7275

73-
- uses: actions/checkout@v4
76+
- name: Checkout PR branch
77+
uses: actions/checkout@v4
7478

75-
- uses: actions-rust-lang/[email protected]
79+
- name: Install Rust
80+
uses: actions-rust-lang/[email protected]
7681
with:
7782
toolchain: nightly-2023-08-25
7883

79-
- uses: taiki-e/[email protected]
84+
- name: Install cargo-public-api
85+
uses: taiki-e/[email protected]
8086
with:
8187
tool: cargo-public-api
8288

83-
- name: generate API diff
89+
- name: Generate API diff
8490
run: |
8591
for f in $(find -mindepth 2 -maxdepth 2 -name Cargo.toml); do
8692
cargo public-api --manifest-path "$f" diff ${{ github.event.pull_request.base.sha }}..${{ github.sha }}

.github/workflows/upload-doc.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- uses: actions/checkout@v4
2323

2424
- name: Install Rust
25-
uses: actions-rust-lang/setup-rust-toolchain@v1.6.0
25+
uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
2626
with:
2727
toolchain: nightly
2828

.prettierrc.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
overrides:
2-
- files: '*.md'
2+
- files: "*.md"
33
options:
44
printWidth: 9999
55
proseWrap: never

actix-files/CHANGES.md

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Unreleased
44

5+
## 0.6.5
6+
7+
- Fix handling of special characters in filenames.
8+
59
## 0.6.4
610

711
- Fix handling of newlines in filenames.

actix-files/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "actix-files"
3-
version = "0.6.4"
3+
version = "0.6.5"
44
authors = [
55
"Nikolay Kim <[email protected]>",
66
"Rob Ede <[email protected]>",

actix-files/README.md

+22-8
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,32 @@
1-
# actix-files
1+
# `actix-files`
22

3-
> Static file serving for Actix Web
3+
<!-- prettier-ignore-start -->
44

55
[![crates.io](https://img.shields.io/crates/v/actix-files?label=latest)](https://crates.io/crates/actix-files)
6-
[![Documentation](https://docs.rs/actix-files/badge.svg?version=0.6.4)](https://docs.rs/actix-files/0.6.4)
6+
[![Documentation](https://docs.rs/actix-files/badge.svg?version=0.6.5)](https://docs.rs/actix-files/0.6.5)
77
![Version](https://img.shields.io/badge/rustc-1.68+-ab6000.svg)
88
![License](https://img.shields.io/crates/l/actix-files.svg)
99
<br />
10-
[![dependency status](https://deps.rs/crate/actix-files/0.6.4/status.svg)](https://deps.rs/crate/actix-files/0.6.4)
10+
[![dependency status](https://deps.rs/crate/actix-files/0.6.5/status.svg)](https://deps.rs/crate/actix-files/0.6.5)
1111
[![Download](https://img.shields.io/crates/d/actix-files.svg)](https://crates.io/crates/actix-files)
1212
[![Chat on Discord](https://img.shields.io/discord/771444961383153695?label=chat&logo=discord)](https://discord.gg/NWpN5mmg3x)
1313

14-
## Documentation & Resources
14+
<!-- prettier-ignore-end -->
1515

16-
- [API Documentation](https://docs.rs/actix-files)
17-
- [Example Project](https://github.com/actix/examples/tree/master/basics/static-files)
18-
- Minimum Supported Rust Version (MSRV): 1.68
16+
<!-- cargo-rdme start -->
17+
18+
Static file serving for Actix Web.
19+
20+
Provides a non-blocking service for serving static files from disk.
21+
22+
## Examples
23+
24+
```rust
25+
use actix_web::App;
26+
use actix_files::Files;
27+
28+
let app = App::new()
29+
.service(Files::new("/static", ".").prefer_utf8(true));
30+
```
31+
32+
<!-- cargo-rdme end -->

actix-files/src/lib.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -569,18 +569,20 @@ mod tests {
569569
}
570570

571571
#[actix_rt::test]
572-
async fn test_static_files_with_newlines() {
572+
async fn test_static_files_with_special_characters() {
573573
// Create the file we want to test against ad-hoc. We can't check it in as otherwise
574574
// Windows can't even checkout this repository.
575575
let temp_dir = tempfile::tempdir().unwrap();
576-
let file_with_newlines = temp_dir.path().join("test\nnewline.text");
576+
let file_with_newlines = temp_dir.path().join("test\n\x0B\x0C\rnewline.text");
577577
fs::write(&file_with_newlines, "Look at my newlines").unwrap();
578578

579579
let srv = test::init_service(
580580
App::new().service(Files::new("/", temp_dir.path()).index_file("Cargo.toml")),
581581
)
582582
.await;
583-
let request = TestRequest::get().uri("/test%0Anewline.text").to_request();
583+
let request = TestRequest::get()
584+
.uri("/test%0A%0B%0C%0Dnewline.text")
585+
.to_request();
584586
let response = test::call_service(&srv, request).await;
585587
assert_eq!(response.status(), StatusCode::OK);
586588

actix-files/src/named.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,12 @@ impl NamedFile {
139139
_ => DispositionType::Attachment,
140140
};
141141

142-
// Replace newlines in filenames which could occur on some filesystems.
143-
let filename_s = filename.replace('\n', "%0A");
142+
// replace special characters in filenames which could occur on some filesystems
143+
let filename_s = filename
144+
.replace('\n', "%0A") // \n line break
145+
.replace('\x0B', "%0B") // \v vertical tab
146+
.replace('\x0C', "%0C") // \f form feed
147+
.replace('\r', "%0D"); // \r carriage return
144148
let mut parameters = vec![DispositionParam::Filename(filename_s)];
145149

146150
if !filename.is_ascii() {

actix-http-test/README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
# actix-http-test
1+
# `actix-http-test`
22

33
> Various helpers for Actix applications to use during testing.
44
5+
<!-- prettier-ignore-start -->
6+
57
[![crates.io](https://img.shields.io/crates/v/actix-http-test?label=latest)](https://crates.io/crates/actix-http-test)
68
[![Documentation](https://docs.rs/actix-http-test/badge.svg?version=3.1.0)](https://docs.rs/actix-http-test/3.1.0)
79
![Version](https://img.shields.io/badge/rustc-1.68+-ab6000.svg)
@@ -11,6 +13,8 @@
1113
[![Download](https://img.shields.io/crates/d/actix-http-test.svg)](https://crates.io/crates/actix-http-test)
1214
[![Chat on Discord](https://img.shields.io/discord/771444961383153695?label=chat&logo=discord)](https://discord.gg/NWpN5mmg3x)
1315

16+
<!-- prettier-ignore-end -->
17+
1418
## Documentation & Resources
1519

1620
- [API Documentation](https://docs.rs/actix-http-test)

actix-http/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ tokio-util = { version = "0.7", features = ["io", "codec"] }
8989
tracing = { version = "0.1.30", default-features = false, features = ["log"] }
9090

9191
# http2
92-
h2 = { version = "0.3.17", optional = true }
92+
h2 = { version = "0.3.24", optional = true }
9393

9494
# websockets
9595
local-channel = { version = "0.1", optional = true }

actix-http/src/requests/head.rs

+3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ pub struct RequestHead {
1616
pub uri: Uri,
1717
pub version: Version,
1818
pub headers: HeaderMap,
19+
20+
/// Will only be None when called in unit tests unless set manually.
1921
pub peer_addr: Option<net::SocketAddr>,
22+
2023
flags: Flags,
2124
}
2225

actix-http/src/requests/request.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ impl<P> Request<P> {
173173
/// Peer address is the directly connected peer's socket address. If a proxy is used in front of
174174
/// the Actix Web server, then it would be address of this proxy.
175175
///
176-
/// Will only return None when called in unit tests.
176+
/// Will only return None when called in unit tests unless set manually.
177177
#[inline]
178178
pub fn peer_addr(&self) -> Option<net::SocketAddr> {
179179
self.head().peer_addr

actix-multipart-derive/README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
# actix-multipart-derive
1+
# `actix-multipart-derive`
22

33
> The derive macro implementation for actix-multipart-derive.
44
5+
<!-- prettier-ignore-start -->
6+
57
[![crates.io](https://img.shields.io/crates/v/actix-multipart-derive?label=latest)](https://crates.io/crates/actix-multipart-derive)
68
[![Documentation](https://docs.rs/actix-multipart-derive/badge.svg?version=0.6.1)](https://docs.rs/actix-multipart-derive/0.6.1)
79
![Version](https://img.shields.io/badge/rustc-1.68+-ab6000.svg)
@@ -11,6 +13,8 @@
1113
[![Download](https://img.shields.io/crates/d/actix-multipart-derive.svg)](https://crates.io/crates/actix-multipart-derive)
1214
[![Chat on Discord](https://img.shields.io/discord/771444961383153695?label=chat&logo=discord)](https://discord.gg/NWpN5mmg3x)
1315

16+
<!-- prettier-ignore-end -->
17+
1418
## Documentation & Resources
1519

1620
- [API Documentation](https://docs.rs/actix-multipart-derive)

actix-multipart/README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
# actix-multipart
1+
# `actix-multipart`
22

33
> Multipart form support for Actix Web.
44
5+
<!-- prettier-ignore-start -->
6+
57
[![crates.io](https://img.shields.io/crates/v/actix-multipart?label=latest)](https://crates.io/crates/actix-multipart)
68
[![Documentation](https://docs.rs/actix-multipart/badge.svg?version=0.6.1)](https://docs.rs/actix-multipart/0.6.1)
79
![Version](https://img.shields.io/badge/rustc-1.68+-ab6000.svg)
@@ -11,6 +13,8 @@
1113
[![Download](https://img.shields.io/crates/d/actix-multipart.svg)](https://crates.io/crates/actix-multipart)
1214
[![Chat on Discord](https://img.shields.io/discord/771444961383153695?label=chat&logo=discord)](https://discord.gg/NWpN5mmg3x)
1315

16+
<!-- prettier-ignore-end -->
17+
1418
## Documentation & Resources
1519

1620
- [API Documentation](https://docs.rs/actix-multipart)

actix-router/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# `actix-router`
22

3+
<!-- prettier-ignore-start -->
4+
35
[![crates.io](https://img.shields.io/crates/v/actix-router?label=latest)](https://crates.io/crates/actix-router)
46
[![Documentation](https://docs.rs/actix-router/badge.svg?version=0.5.2)](https://docs.rs/actix-router/0.5.2)
57
![Version](https://img.shields.io/badge/rustc-1.68+-ab6000.svg)
@@ -9,6 +11,8 @@
911
[![Download](https://img.shields.io/crates/d/actix-router.svg)](https://crates.io/crates/actix-router)
1012
[![Chat on Discord](https://img.shields.io/discord/771444961383153695?label=chat&logo=discord)](https://discord.gg/NWpN5mmg3x)
1113

14+
<!-- prettier-ignore-end -->
15+
1216
<!-- cargo-rdme start -->
1317

1418
Resource path matching and router.

actix-web-actors/README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
# actix-web-actors
1+
# `actix-web-actors`
22

33
> Actix actors support for Actix Web.
44
5+
<!-- prettier-ignore-start -->
6+
57
[![crates.io](https://img.shields.io/crates/v/actix-web-actors?label=latest)](https://crates.io/crates/actix-web-actors)
68
[![Documentation](https://docs.rs/actix-web-actors/badge.svg?version=4.2.0)](https://docs.rs/actix-web-actors/4.2.0)
79
![Version](https://img.shields.io/badge/rustc-1.68+-ab6000.svg)
@@ -11,6 +13,8 @@
1113
[![Download](https://img.shields.io/crates/d/actix-web-actors.svg)](https://crates.io/crates/actix-web-actors)
1214
[![Chat on Discord](https://img.shields.io/discord/771444961383153695?label=chat&logo=discord)](https://discord.gg/NWpN5mmg3x)
1315

16+
<!-- prettier-ignore-end -->
17+
1418
## Documentation & Resources
1519

1620
- [API Documentation](https://docs.rs/actix-web-actors)

0 commit comments

Comments
 (0)