Skip to content

Commit

Permalink
Merge branch 'master' into asonix/actix-web-rustls-0.23
Browse files Browse the repository at this point in the history
  • Loading branch information
robjtede committed May 18, 2024
2 parents fc17449 + fff45b2 commit 261e9d6
Show file tree
Hide file tree
Showing 22 changed files with 119 additions and 90 deletions.
4 changes: 0 additions & 4 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,3 @@ ci-check-default = "hack --workspace check"
ci-check-default-tests = "check --workspace --tests"
ci-check-all-feature-powerset="hack --workspace --feature-powerset --skip=__compress,experimental-io-uring check"
ci-check-all-feature-powerset-linux="hack --workspace --feature-powerset --skip=__compress check"

# testing
ci-doctest-default = "test --workspace --doc --no-fail-fast -- --nocapture"
ci-doctest = "test --workspace --all-features --doc --no-fail-fast -- --nocapture"
40 changes: 5 additions & 35 deletions .github/workflows/ci-post-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ jobs:
with:
toolchain: ${{ matrix.version.version }}

- name: Install cargo-hack and cargo-ci-cache-clean
uses: taiki-e/install-action@v2.33.12
- name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean
uses: taiki-e/install-action@v2.33.22
with:
tool: cargo-hack,cargo-ci-cache-clean
tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean

- name: check minimal
run: cargo ci-check-min
Expand All @@ -57,19 +57,7 @@ jobs:

- name: tests
timeout-minutes: 60
shell: bash
run: |
set -e
cargo test --lib --tests -p=actix-router --all-features
cargo test --lib --tests -p=actix-http --all-features
cargo test --lib --tests -p=actix-web --features=rustls-0_20,rustls-0_21,rustls-0_22,rustls-0_23,openssl -- --skip=test_reading_deflate_encoding_large_random_rustls
cargo test --lib --tests -p=actix-web-codegen --all-features
cargo test --lib --tests -p=awc --all-features
cargo test --lib --tests -p=actix-http-test --all-features
cargo test --lib --tests -p=actix-test --all-features
cargo test --lib --tests -p=actix-files
cargo test --lib --tests -p=actix-multipart --all-features
cargo test --lib --tests -p=actix-web-actors --all-features
run: just test

- name: CI cache clean
run: cargo-ci-cache-clean
Expand All @@ -88,7 +76,7 @@ jobs:
uses: actions-rust-lang/setup-rust-toolchain@v1.8.0

- name: Install cargo-hack
uses: taiki-e/install-action@v2.33.12
uses: taiki-e/install-action@v2.33.22
with:
tool: cargo-hack

Expand All @@ -97,21 +85,3 @@ jobs:

- name: check feature combinations
run: cargo ci-check-all-feature-powerset-linux

nextest:
name: nextest
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1.8.0

- name: Install nextest
uses: taiki-e/install-action@v2.33.12
with:
tool: nextest

- name: Test with cargo-nextest
run: cargo nextest run
40 changes: 18 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ concurrency:
cancel-in-progress: true

jobs:
read_msrv:
name: Read MSRV
uses: actions-rust-lang/msrv/.github/workflows/msrv.yml@main

build_and_test:
needs: read_msrv

strategy:
fail-fast: false
matrix:
Expand All @@ -26,7 +32,7 @@ jobs:
- { name: macOS, os: macos-latest, triple: x86_64-apple-darwin }
- { name: Windows, os: windows-latest, triple: x86_64-pc-windows-msvc }
version:
- { name: msrv, version: 1.72.0 }
- { name: msrv, version: "${{ needs.read_msrv.outputs.msrv }}" }
- { name: stable, version: stable }

name: ${{ matrix.target.name }} / ${{ matrix.version.name }}
Expand All @@ -49,15 +55,14 @@ jobs:
with:
toolchain: ${{ matrix.version.version }}

- name: Install cargo-hack and cargo-ci-cache-clean
uses: taiki-e/install-action@v2.33.12
- name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean
uses: taiki-e/install-action@v2.33.22
with:
tool: cargo-hack,cargo-ci-cache-clean
tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean

- name: workaround MSRV issues
if: matrix.version.name == 'msrv'
run: |
cargo update -p=clap --precise=4.4.18
run: just downgrade-for-msrv

- name: check minimal
run: cargo ci-check-min
Expand All @@ -67,20 +72,7 @@ jobs:

- name: tests
timeout-minutes: 60
shell: bash
run: |
set -e
cargo test --lib --tests -p=actix-router --no-default-features
cargo test --lib --tests -p=actix-router --all-features
cargo test --lib --tests -p=actix-http --all-features
cargo test --lib --tests -p=actix-web --features=rustls-0_20,rustls-0_21,rustls-0_22,rustls-0_23,openssl -- --skip=test_reading_deflate_encoding_large_random_rustls
cargo test --lib --tests -p=actix-web-codegen --all-features
cargo test --lib --tests -p=awc --all-features
cargo test --lib --tests -p=actix-http-test --all-features
cargo test --lib --tests -p=actix-test --all-features
cargo test --lib --tests -p=actix-files
cargo test --lib --tests -p=actix-multipart --all-features
cargo test --lib --tests -p=actix-web-actors --all-features
run: just test

- name: CI cache clean
run: cargo-ci-cache-clean
Expand Down Expand Up @@ -112,6 +104,10 @@ jobs:
with:
toolchain: nightly

- name: Install just
uses: taiki-e/install-action@v2.33.22
with:
tool: just

- name: doc tests
run: cargo ci-doctest
timeout-minutes: 60
run: just test-docs
4 changes: 2 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ jobs:
components: llvm-tools-preview

- name: Install cargo-llvm-cov
uses: taiki-e/install-action@v2.33.12
uses: taiki-e/install-action@v2.33.22
with:
tool: cargo-llvm-cov

- name: Generate code coverage
run: cargo llvm-cov --workspace --all-features --codecov --output-path codecov.json

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4.3.0
uses: codecov/codecov-action@v4.3.1
with:
files: codecov.json
fail_ci_if_error: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
toolchain: nightly-2024-04-26

- name: Install cargo-public-api
uses: taiki-e/install-action@v2.33.12
uses: taiki-e/install-action@v2.33.22
with:
tool: cargo-public-api

Expand Down
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ members = [
]

[workspace.package]
homepage = "https://actix.rs"
repository = "https://github.com/actix/actix-web"
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.72"
Expand Down
1 change: 1 addition & 0 deletions actix-http/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

### Changed

- Update `brotli` dependency to `6`.
- Minimum supported Rust version (MSRV) is now 1.72.

## 3.6.0
Expand Down
2 changes: 1 addition & 1 deletion actix-http/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ sha1 = { version = "0.10", optional = true }
actix-tls = { version = "3.3", default-features = false, optional = true }

# compress-*
brotli = { version = "3.3.3", optional = true }
brotli = { version = "6", optional = true }
flate2 = { version = "1.0.13", optional = true }
zstd = { version = "0.13", optional = true }

Expand Down
2 changes: 1 addition & 1 deletion actix-http/src/h1/dispatcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ where

req.head_mut().peer_addr = *this.peer_addr;

req.conn_data = this.conn_data.clone();
req.conn_data.clone_from(this.conn_data);

match this.codec.message_type() {
// request has no payload
Expand Down
2 changes: 1 addition & 1 deletion actix-http/src/h2/dispatcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ where
head.headers = parts.headers.into();
head.peer_addr = this.peer_addr;

req.conn_data = this.conn_data.clone();
req.conn_data.clone_from(&this.conn_data);

let fut = this.flow.service.call(req);
let config = this.config.clone();
Expand Down
9 changes: 5 additions & 4 deletions actix-multipart-derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ version = "0.6.1"
authors = ["Jacob Halsey <jacob@jhalsey.com>"]
description = "Multipart form derive macro for Actix Web"
keywords = ["http", "web", "framework", "async", "futures"]
homepage = "https://actix.rs"
repository = "https://github.com/actix/actix-web"
license = "MIT OR Apache-2.0"
edition = "2021"
homepage.workspace = true
repository.workspace = true
license.workspace = true
edition.workspace = true
rust-version.workspace = true

[package.metadata.docs.rs]
rustdoc-args = ["--cfg", "docsrs"]
Expand Down
3 changes: 2 additions & 1 deletion actix-multipart/src/form/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,8 @@ where
let entry = field_limits
.entry(field.name().to_owned())
.or_insert_with(|| T::limit(field.name()));
limits.field_limit_remaining = entry.to_owned();

limits.field_limit_remaining.clone_from(entry);

T::handle_field(&req, field, &mut limits, &mut state).await?;

Expand Down
8 changes: 2 additions & 6 deletions actix-router/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,11 @@ impl<T: ResourcePath> Path<T> {
None
}

/// Get matched parameter by name.
/// Returns matched parameter by name.
///
/// If keyed parameter is not available empty string is used as default value.
pub fn query(&self, key: &str) -> &str {
if let Some(s) = self.get(key) {
s
} else {
""
}
self.get(key).unwrap_or_default()
}

/// Return iterator to items in parameter container.
Expand Down
9 changes: 5 additions & 4 deletions actix-web-codegen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
name = "actix-web-codegen"
version = "4.2.2"
description = "Routing and runtime macros for Actix Web"
homepage = "https://actix.rs"
repository = "https://github.com/actix/actix-web"
authors = [
"Nikolay Kim <fafhrd91@gmail.com>",
"Rob Ede <robjtede@icloud.com>",
]
license = "MIT OR Apache-2.0"
edition = "2021"
homepage.workspace = true
repository.workspace = true
license.workspace = true
edition.workspace = true
rust-version.workspace = true

[lib]
proc-macro = true
Expand Down
5 changes: 5 additions & 0 deletions actix-web/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,14 @@

### Changed

- Update `brotli` dependency to `6`.
- Minimum supported Rust version (MSRV) is now 1.72.
- Avoid type confusion in rare circumstances

### Fixed

- Avoid type confusion with `rustls` in some circumstances.

## 4.5.1

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion actix-web/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ actix-files = "0.6"
actix-test = { version = "0.1", features = ["openssl", "rustls-0_23"] }
awc = { version = "3", features = ["openssl"] }

brotli = "3.3.3"
brotli = "6"
const-str = "0.5"
criterion = { version = "0.5", features = ["html_reports"] }
env_logger = "0.11"
Expand Down
2 changes: 1 addition & 1 deletion actix-web/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ impl AppConfig {

#[cfg(test)]
pub(crate) fn set_host(&mut self, host: &str) {
self.host = host.to_owned();
host.clone_into(&mut self.host);
}
}

Expand Down
2 changes: 1 addition & 1 deletion actix-web/src/resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ mod tests {
data3: web::Data<f64>| {
assert_eq!(**data1, 10);
assert_eq!(**data2, '*');
let error = std::f64::EPSILON;
let error = f64::EPSILON;
assert!((**data3 - 1.0).abs() < error);
HttpResponse::Ok()
},
Expand Down
1 change: 1 addition & 0 deletions awc/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased

- Update `brotli` dependency to `6`.
- Minimum supported Rust version (MSRV) is now 1.72.
- Add `rustls-0_23`, `rustls-0_23-webpki-roots`, and `rustls-0_23-native-roots` crate features.
- Add `awc::Connector::rustls_0_23()` method.
Expand Down
2 changes: 1 addition & 1 deletion awc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ actix-tls = { version = "3.3", features = ["openssl", "rustls-0_23"] }
actix-utils = "3"
actix-web = { version = "4", features = ["openssl"] }

brotli = "3.3.3"
brotli = "6"
const-str = "0.5"
env_logger = "0.11"
flate2 = "1.0.13"
Expand Down
16 changes: 16 additions & 0 deletions awc/src/client/connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,14 @@ where

/// service for establish tcp connection and do client tls handshake.
/// operation is canceled when timeout limit reached.
#[cfg(any(
feature = "dangerous-h2c",
feature = "openssl",
feature = "rustls-0_20",
feature = "rustls-0_21",
feature = "rustls-0_22-webpki-roots",
feature = "rustls-0_22-native-roots",
))]
struct TlsConnectorService<Tcp, Tls> {
/// TCP connection is canceled on `TcpConnectorInnerService`'s timeout setting.
tcp_service: Tcp,
Expand All @@ -743,6 +751,14 @@ struct TlsConnectorService<Tcp, Tls> {
timeout: Duration,
}

#[cfg(any(
feature = "dangerous-h2c",
feature = "openssl",
feature = "rustls-0_20",
feature = "rustls-0_21",
feature = "rustls-0_22-webpki-roots",
feature = "rustls-0_22-native-roots",
))]
impl<Tcp, Tls, IO> Service<Connect> for TlsConnectorService<Tcp, Tls>
where
Tcp:
Expand Down
Loading

0 comments on commit 261e9d6

Please sign in to comment.