Skip to content

Commit

Permalink
Merge branch 'master' into documentation-actix-multipart
Browse files Browse the repository at this point in the history
  • Loading branch information
robjtede committed May 18, 2024
2 parents 57888d4 + 2d035c0 commit 1db7d9d
Show file tree
Hide file tree
Showing 32 changed files with 390 additions and 129 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"
44 changes: 9 additions & 35 deletions .github/workflows/ci-post-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install nasm
if: matrix.target.os == 'windows-latest'
uses: ilammy/setup-nasm@v1.5.1

- name: Install OpenSSL
if: matrix.target.os == 'windows-latest'
shell: bash
Expand All @@ -44,10 +48,10 @@ jobs:
with:
toolchain: ${{ matrix.version.version }}

- name: Install cargo-hack and cargo-ci-cache-clean
uses: taiki-e/install-action@v2.32.17
- 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 +61,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,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 +80,7 @@ jobs:
uses: actions-rust-lang/setup-rust-toolchain@v1.8.0

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

Expand All @@ -97,21 +89,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.32.17
with:
tool: nextest

- name: Test with cargo-nextest
run: cargo nextest run
44 changes: 22 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 @@ -35,6 +41,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install nasm
if: matrix.target.os == 'windows-latest'
uses: ilammy/setup-nasm@v1.5.1

- name: Install OpenSSL
if: matrix.target.os == 'windows-latest'
shell: bash
Expand All @@ -49,15 +59,14 @@ jobs:
with:
toolchain: ${{ matrix.version.version }}

- name: Install cargo-hack and cargo-ci-cache-clean
uses: taiki-e/install-action@v2.32.17
- 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 +76,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,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 +108,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.32.17
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
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ jobs:
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
with:
toolchain: nightly-2023-08-25
toolchain: nightly-2024-04-26

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

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/upload-doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
run: echo '<meta http-equiv="refresh" content="0;url=actix_web/index.html">' > target/doc/index.html

- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4.5.0
uses: JamesIves/github-pages-deploy-action@v4.6.0
with:
folder: target/doc
single-commit: true
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
6 changes: 6 additions & 0 deletions actix-http/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@

## Unreleased

### Added

- Add `rustls-0_23` crate feature
- Add `{h1::H1Service, h2::H2Service, HttpService}::rustls_0_23()` and `HttpService::rustls_0_23_with_config()` service constructors.

### Changed

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

## 3.6.0
Expand Down
14 changes: 9 additions & 5 deletions actix-http/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ features = [
"rustls-0_20",
"rustls-0_21",
"rustls-0_22",
"rustls-0_23",
"compress-brotli",
"compress-gzip",
"compress-zstd",
Expand Down Expand Up @@ -66,6 +67,9 @@ rustls-0_21 = ["actix-tls/accept", "actix-tls/rustls-0_21"]
# TLS via Rustls v0.22
rustls-0_22 = ["actix-tls/accept", "actix-tls/rustls-0_22"]

# TLS via Rustls v0.23
rustls-0_23 = ["actix-tls/accept", "actix-tls/rustls-0_23"]

# Compression codecs
compress-brotli = ["__compress", "brotli"]
compress-gzip = ["__compress", "flate2"]
Expand Down Expand Up @@ -114,14 +118,14 @@ 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 }

[dev-dependencies]
actix-http-test = { version = "3", features = ["openssl"] }
actix-server = "2"
actix-tls = { version = "3.3", features = ["openssl", "rustls-0_22-webpki-roots"] }
actix-tls = { version = "3.4", features = ["openssl", "rustls-0_23-webpki-roots"] }
actix-web = "4"

async-stream = "0.3"
Expand All @@ -139,16 +143,16 @@ serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
static_assertions = "1"
tls-openssl = { package = "openssl", version = "0.10.55" }
tls-rustls_022 = { package = "rustls", version = "0.22" }
tls-rustls_023 = { package = "rustls", version = "0.23" }
tokio = { version = "1.24.2", features = ["net", "rt", "macros"] }

[[example]]
name = "ws"
required-features = ["ws", "rustls-0_22"]
required-features = ["ws", "rustls-0_23"]

[[example]]
name = "tls_rustls"
required-features = ["http2", "rustls-0_22"]
required-features = ["http2", "rustls-0_23"]

[[bench]]
name = "response-body-compression"
Expand Down
5 changes: 2 additions & 3 deletions actix-http/examples/tls_rustls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@
//! Protocol: HTTP/1.1
//! ```

extern crate tls_rustls_022 as rustls;

use std::io;

use actix_http::{Error, HttpService, Request, Response};
use actix_utils::future::ok;
use tls_rustls_023 as rustls;

#[actix_rt::main]
async fn main() -> io::Result<()> {
Expand All @@ -36,7 +35,7 @@ async fn main() -> io::Result<()> {
);
ok::<_, Error>(Response::ok().set_body(body))
})
.rustls_0_22(rustls_config())
.rustls_0_23(rustls_config())
})?
.run()
.await
Expand Down
4 changes: 2 additions & 2 deletions actix-http/examples/ws.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Sets up a WebSocket server over TCP and TLS.
//! Sends a heartbeat message every 4 seconds but does not respond to any incoming frames.

extern crate tls_rustls_022 as rustls;
extern crate tls_rustls_023 as rustls;

use std::{
io,
Expand Down Expand Up @@ -30,7 +30,7 @@ async fn main() -> io::Result<()> {
.bind("tls", ("127.0.0.1", 8443), || {
HttpService::build()
.finish(handler)
.rustls_0_22(tls_config())
.rustls_0_23(tls_config())
})?
.run()
.await
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
Loading

0 comments on commit 1db7d9d

Please sign in to comment.