diff --git a/.cargo/config.toml b/.cargo/config.toml
deleted file mode 100644
index a2345e18..00000000
--- a/.cargo/config.toml
+++ /dev/null
@@ -1,10 +0,0 @@
-[alias]
-lint = "clippy --workspace --all-targets -- -Dclippy::todo"
-lint-all = "clippy --workspace --all-features --all-targets -- -Dclippy::todo"
-
-# lib checking
-ci-check-min = "hack --workspace check --no-default-features"
-ci-check-default = "hack --workspace check"
-ci-check-default-tests = "check --workspace --tests"
-ci-check-all-feature-powerset="hack --workspace --feature-powerset --depth=4 --skip=__compress,experimental-io-uring check"
-ci-check-all-feature-powerset-linux="hack --workspace --feature-powerset --depth=4 --skip=__compress check"
diff --git a/.clippy.toml b/.clippy.toml
new file mode 100644
index 00000000..8c0cbc8b
--- /dev/null
+++ b/.clippy.toml
@@ -0,0 +1,7 @@
+disallowed-names = [
+ "e", # no single letter error bindings
+]
+disallowed-methods = [
+ "std::cell::RefCell::default()",
+ "std::rc::Rc::default()",
+]
diff --git a/.github/workflows/ci-post-merge.yml b/.github/workflows/ci-post-merge.yml
index 8d509d69..f0ed2173 100644
--- a/.github/workflows/ci-post-merge.yml
+++ b/.github/workflows/ci-post-merge.yml
@@ -44,20 +44,20 @@ jobs:
echo "RUSTFLAGS=-C target-feature=+crt-static" >> $GITHUB_ENV
- name: Install Rust (${{ matrix.version.name }})
- uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
+ uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
with:
toolchain: ${{ matrix.version.version }}
- name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean
- uses: taiki-e/install-action@v2.33.22
+ uses: taiki-e/install-action@v2.44.60
with:
tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean
- name: check minimal
- run: cargo ci-check-min
+ run: just check-min
- name: check default
- run: cargo ci-check-default
+ run: just check-default
- name: tests
timeout-minutes: 60
@@ -76,16 +76,16 @@ jobs:
- name: Free Disk Space
run: ./scripts/free-disk-space.sh
+ - name: Setup mold linker
+ uses: rui314/setup-mold@v1
+
- name: Install Rust
- uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
+ uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
- - name: Install cargo-hack
- uses: taiki-e/install-action@v2.33.22
+ - name: Install just, cargo-hack
+ uses: taiki-e/install-action@v2.44.60
with:
- tool: cargo-hack
+ tool: just,cargo-hack
- - name: check feature combinations
- run: cargo ci-check-all-feature-powerset
-
- - name: check feature combinations
- run: cargo ci-check-all-feature-powerset-linux
+ - name: Check feature combinations
+ run: just check-feature-combinations
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index a81f0e8e..b04213dc 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -18,7 +18,7 @@ concurrency:
jobs:
read_msrv:
name: Read MSRV
- uses: actions-rust-lang/msrv/.github/workflows/msrv.yml@main
+ uses: actions-rust-lang/msrv/.github/workflows/msrv.yml@v0.1.0
build_and_test:
needs: read_msrv
@@ -59,12 +59,12 @@ jobs:
uses: rui314/setup-mold@v1
- name: Install Rust (${{ matrix.version.name }})
- uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
+ uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
with:
toolchain: ${{ matrix.version.version }}
- name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean
- uses: taiki-e/install-action@v2.33.22
+ uses: taiki-e/install-action@v2.44.60
with:
tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean
@@ -73,10 +73,10 @@ jobs:
run: just downgrade-for-msrv
- name: check minimal
- run: cargo ci-check-min
+ run: just check-min
- name: check default
- run: cargo ci-check-default
+ run: just check-default
- name: tests
timeout-minutes: 60
@@ -92,7 +92,7 @@ jobs:
- uses: actions/checkout@v4
- name: Install Rust
- uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
+ uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
with:
toolchain: nightly
@@ -108,12 +108,12 @@ jobs:
- uses: actions/checkout@v4
- name: Install Rust (nightly)
- uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
+ uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
with:
toolchain: nightly
- name: Install just
- uses: taiki-e/install-action@v2.33.22
+ uses: taiki-e/install-action@v2.44.60
with:
tool: just
diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml
index 943f6322..1d4e580c 100644
--- a/.github/workflows/coverage.yml
+++ b/.github/workflows/coverage.yml
@@ -17,21 +17,22 @@ jobs:
steps:
- uses: actions/checkout@v4
- - name: Install Rust
- uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
+ - name: Install Rust (nightly)
+ uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
with:
- components: llvm-tools-preview
+ toolchain: nightly
+ components: llvm-tools
- - name: Install cargo-llvm-cov
- uses: taiki-e/install-action@v2.33.22
+ - name: Install just, cargo-llvm-cov, cargo-nextest
+ uses: taiki-e/install-action@v2.44.60
with:
- tool: cargo-llvm-cov
+ tool: just,cargo-llvm-cov,cargo-nextest
- name: Generate code coverage
- run: cargo llvm-cov --workspace --all-features --codecov --output-path codecov.json
+ run: just test-coverage-codecov
- name: Upload coverage to Codecov
- uses: codecov/codecov-action@v4.3.1
+ uses: codecov/codecov-action@v4.6.0
with:
files: codecov.json
fail_ci_if_error: true
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 03b25ecd..94380aee 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -18,7 +18,7 @@ jobs:
- uses: actions/checkout@v4
- name: Install Rust (nightly)
- uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
+ uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
with:
toolchain: nightly
components: rustfmt
@@ -36,7 +36,7 @@ jobs:
- uses: actions/checkout@v4
- name: Install Rust
- uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
+ uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
with:
components: clippy
@@ -55,7 +55,7 @@ jobs:
- uses: actions/checkout@v4
- name: Install Rust (nightly)
- uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
+ uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
with:
toolchain: nightly
components: rust-docs
@@ -65,6 +65,30 @@ jobs:
RUSTDOCFLAGS: -D warnings
run: cargo +nightly doc --no-deps --workspace --all-features
+ check-external-types:
+ if: false # disable until https://github.com/awslabs/cargo-check-external-types/pull/177 is marged
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Install Rust (nightly-2024-05-01)
+ uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
+ with:
+ toolchain: nightly-2024-05-01
+
+ - name: Install just
+ uses: taiki-e/install-action@v2.44.60
+ with:
+ tool: just
+
+ - name: Install cargo-check-external-types
+ uses: taiki-e/cache-cargo-install-action@v2.0.1
+ with:
+ tool: cargo-check-external-types
+
+ - name: check external types
+ run: just check-external-types-all +nightly-2024-05-01
+
public-api-diff:
runs-on: ubuntu-latest
steps:
@@ -76,18 +100,18 @@ jobs:
- name: Checkout PR branch
uses: actions/checkout@v4
- - name: Install Rust
- uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
+ - name: Install Rust (nightly-2024-09-30)
+ uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
with:
- toolchain: nightly-2024-04-26
+ toolchain: nightly-2024-09-30
- name: Install cargo-public-api
- uses: taiki-e/install-action@v2.33.22
+ uses: taiki-e/install-action@v2.44.60
with:
tool: cargo-public-api
- name: Generate API diff
run: |
for f in $(find -mindepth 2 -maxdepth 2 -name Cargo.toml); do
- cargo public-api --manifest-path "$f" diff ${{ github.event.pull_request.base.sha }}..${{ github.sha }}
+ cargo public-api --manifest-path "$f" --simplified diff ${{ github.event.pull_request.base.sha }}..${{ github.sha }}
done
diff --git a/.github/workflows/upload-doc.yml b/.github/workflows/upload-doc.yml
deleted file mode 100644
index 6352e44d..00000000
--- a/.github/workflows/upload-doc.yml
+++ /dev/null
@@ -1,41 +0,0 @@
-name: Upload Documentation
-
-on:
- push:
- branches: [master]
-
-permissions:
- contents: read
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.ref }}
- cancel-in-progress: true
-
-jobs:
- build:
- permissions:
- contents: write
-
- runs-on: ubuntu-latest
-
- steps:
- - uses: actions/checkout@v4
-
- - name: Install Rust
- uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
- with:
- toolchain: nightly
-
- - name: Build Docs
- run: cargo +nightly doc --no-deps --workspace --all-features
- env:
- RUSTDOCFLAGS: --cfg=docsrs
-
- - name: Tweak HTML
- run: echo '' > target/doc/index.html
-
- - name: Deploy to GitHub Pages
- uses: JamesIves/github-pages-deploy-action@v4.6.0
- with:
- folder: target/doc
- single-commit: true
diff --git a/Cargo.toml b/Cargo.toml
index 19d5dd11..d5601f8f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -19,7 +19,7 @@ homepage = "https://actix.rs"
repository = "https://github.com/actix/actix-web"
license = "MIT OR Apache-2.0"
edition = "2021"
-rust-version = "1.72"
+rust-version = "1.75"
[profile.dev]
# Disabling debug info speeds up builds a bunch and we don't rely on it for debugging that much.
@@ -51,3 +51,11 @@ awc = { path = "awc" }
# actix-utils = { path = "../actix-net/actix-utils" }
# actix-tls = { path = "../actix-net/actix-tls" }
# actix-server = { path = "../actix-net/actix-server" }
+
+[workspace.lints.rust]
+rust_2018_idioms = { level = "deny" }
+future_incompatible = { level = "deny" }
+nonstandard_style = { level = "deny" }
+
+[workspace.lints.clippy]
+# clone_on_ref_ptr = { level = "deny" }
diff --git a/actix-files/CHANGES.md b/actix-files/CHANGES.md
index 393e7b61..afb2d5d2 100644
--- a/actix-files/CHANGES.md
+++ b/actix-files/CHANGES.md
@@ -2,6 +2,11 @@
## Unreleased
+- Minimum supported Rust version (MSRV) is now 1.75.
+
+## 0.6.6
+
+- Update `tokio-uring` dependency to `0.4`.
- Minimum supported Rust version (MSRV) is now 1.72.
## 0.6.5
diff --git a/actix-files/Cargo.toml b/actix-files/Cargo.toml
index 3d82f8a7..48d38874 100644
--- a/actix-files/Cargo.toml
+++ b/actix-files/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "actix-files"
-version = "0.6.5"
+version = "0.6.6"
authors = [
"Nikolay Kim ",
"Rob Ede ",
@@ -13,9 +13,14 @@ categories = ["asynchronous", "web-programming::http-server"]
license = "MIT OR Apache-2.0"
edition = "2021"
-[lib]
-name = "actix_files"
-path = "src/lib.rs"
+[package.metadata.cargo_check_external_types]
+allowed_external_types = [
+ "actix_http::*",
+ "actix_service::*",
+ "actix_web::*",
+ "http::*",
+ "mime::*",
+]
[features]
experimental-io-uring = ["actix-web/experimental-io-uring", "tokio-uring"]
@@ -28,7 +33,7 @@ actix-web = { version = "4", default-features = false }
bitflags = "2"
bytes = "1"
-derive_more = "0.99.5"
+derive_more = { version = "1", features = ["display", "error", "from"] }
futures-core = { version = "0.3.17", default-features = false, features = ["alloc"] }
http-range = "0.1.4"
log = "0.4"
@@ -40,8 +45,8 @@ v_htmlescape = "0.15.5"
# experimental-io-uring
[target.'cfg(target_os = "linux")'.dependencies]
-tokio-uring = { version = "0.4", optional = true, features = ["bytes"] }
-actix-server = { version = "2.2", optional = true } # ensure matching tokio-uring versions
+tokio-uring = { version = "0.5", optional = true, features = ["bytes"] }
+actix-server = { version = "2.4", optional = true } # ensure matching tokio-uring versions
[dev-dependencies]
actix-rt = "2.7"
@@ -49,3 +54,6 @@ actix-test = "0.1"
actix-web = "4"
env_logger = "0.11"
tempfile = "3.2"
+
+[lints]
+workspace = true
diff --git a/actix-files/README.md b/actix-files/README.md
index a6b3f63c..f6d5143f 100644
--- a/actix-files/README.md
+++ b/actix-files/README.md
@@ -3,11 +3,11 @@
[](https://crates.io/crates/actix-files)
-[](https://docs.rs/actix-files/0.6.5)
+[](https://docs.rs/actix-files/0.6.6)


-[](https://deps.rs/crate/actix-files/0.6.5)
+[](https://deps.rs/crate/actix-files/0.6.6)
[](https://crates.io/crates/actix-files)
[](https://discord.gg/NWpN5mmg3x)
diff --git a/actix-files/src/error.rs b/actix-files/src/error.rs
index d614651f..1d481888 100644
--- a/actix-files/src/error.rs
+++ b/actix-files/src/error.rs
@@ -1,16 +1,16 @@
use actix_web::{http::StatusCode, ResponseError};
-use derive_more::Display;
+use derive_more::derive::Display;
/// Errors which can occur when serving static files.
#[derive(Debug, PartialEq, Eq, Display)]
pub enum FilesError {
/// Path is not a directory.
#[allow(dead_code)]
- #[display(fmt = "path is not a directory. Unable to serve static files")]
+ #[display("path is not a directory. Unable to serve static files")]
IsNotDirectory,
/// Cannot render directory.
- #[display(fmt = "unable to render directory without index file")]
+ #[display("unable to render directory without index file")]
IsDirectory,
}
@@ -25,19 +25,19 @@ impl ResponseError for FilesError {
#[non_exhaustive]
pub enum UriSegmentError {
/// Segment started with the wrapped invalid character.
- #[display(fmt = "segment started with invalid character: ('{_0}')")]
+ #[display("segment started with invalid character: ('{_0}')")]
BadStart(char),
/// Segment contained the wrapped invalid character.
- #[display(fmt = "segment contained invalid character ('{_0}')")]
+ #[display("segment contained invalid character ('{_0}')")]
BadChar(char),
/// Segment ended with the wrapped invalid character.
- #[display(fmt = "segment ended with invalid character: ('{_0}')")]
+ #[display("segment ended with invalid character: ('{_0}')")]
BadEnd(char),
/// Path is not a valid UTF-8 string after percent-decoding.
- #[display(fmt = "path is not a valid UTF-8 string after percent-decoding")]
+ #[display("path is not a valid UTF-8 string after percent-decoding")]
NotValidUtf8,
}
diff --git a/actix-files/src/lib.rs b/actix-files/src/lib.rs
index 167f996c..551a14fa 100644
--- a/actix-files/src/lib.rs
+++ b/actix-files/src/lib.rs
@@ -11,8 +11,7 @@
//! .service(Files::new("/static", ".").prefer_utf8(true));
//! ```
-#![deny(rust_2018_idioms, nonstandard_style)]
-#![warn(future_incompatible, missing_docs, missing_debug_implementations)]
+#![warn(missing_docs, missing_debug_implementations)]
#![doc(html_logo_url = "https://actix.rs/img/logo.png")]
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
@@ -307,11 +306,11 @@ mod tests {
let resp = file.respond_to(&req);
assert_eq!(
resp.headers().get(header::CONTENT_TYPE).unwrap(),
- "application/javascript; charset=utf-8"
+ "text/javascript",
);
assert_eq!(
resp.headers().get(header::CONTENT_DISPOSITION).unwrap(),
- "inline; filename=\"test.js\""
+ "inline; filename=\"test.js\"",
);
}
diff --git a/actix-files/src/named.rs b/actix-files/src/named.rs
index 9e4a3773..7f839890 100644
--- a/actix-files/src/named.rs
+++ b/actix-files/src/named.rs
@@ -21,7 +21,7 @@ use actix_web::{
Error, HttpMessage, HttpRequest, HttpResponse, Responder,
};
use bitflags::bitflags;
-use derive_more::{Deref, DerefMut};
+use derive_more::derive::{Deref, DerefMut};
use futures_core::future::LocalBoxFuture;
use mime::Mime;
diff --git a/actix-files/src/range.rs b/actix-files/src/range.rs
index 528911ae..c6e34632 100644
--- a/actix-files/src/range.rs
+++ b/actix-files/src/range.rs
@@ -1,6 +1,6 @@
use std::fmt;
-use derive_more::Error;
+use derive_more::derive::Error;
/// Copy of `http_range::HttpRangeParseError`.
#[derive(Debug, Clone)]
diff --git a/actix-files/src/service.rs b/actix-files/src/service.rs
index 3d3b36c4..393ad924 100644
--- a/actix-files/src/service.rs
+++ b/actix-files/src/service.rs
@@ -79,7 +79,7 @@ impl FilesService {
let (req, _) = req.into_parts();
- (self.renderer)(&dir, &req).unwrap_or_else(|e| ServiceResponse::from_err(e, req))
+ (self.renderer)(&dir, &req).unwrap_or_else(|err| ServiceResponse::from_err(err, req))
}
}
diff --git a/actix-http-test/Cargo.toml b/actix-http-test/Cargo.toml
index bfb0a353..7ccb70a4 100644
--- a/actix-http-test/Cargo.toml
+++ b/actix-http-test/Cargo.toml
@@ -18,9 +18,17 @@ edition = "2021"
[package.metadata.docs.rs]
features = []
-[lib]
-name = "actix_http_test"
-path = "src/lib.rs"
+[package.metadata.cargo_check_external_types]
+allowed_external_types = [
+ "actix_codec::*",
+ "actix_http::*",
+ "actix_server::*",
+ "awc::*",
+ "bytes::*",
+ "futures_core::*",
+ "http::*",
+ "tokio::*",
+]
[features]
default = []
@@ -51,3 +59,6 @@ tokio = { version = "1.24.2", features = ["sync"] }
[dev-dependencies]
actix-http = "3"
+
+[lints]
+workspace = true
diff --git a/actix-http-test/README.md b/actix-http-test/README.md
index ee242d1d..93902812 100644
--- a/actix-http-test/README.md
+++ b/actix-http-test/README.md
@@ -1,7 +1,5 @@
# `actix-http-test`
-> Various helpers for Actix applications to use during testing.
-
[](https://crates.io/crates/actix-http-test)
@@ -14,3 +12,9 @@
[](https://discord.gg/NWpN5mmg3x)
+
+
+
+Various helpers for Actix applications to use during testing.
+
+
diff --git a/actix-http-test/src/lib.rs b/actix-http-test/src/lib.rs
index 554af910..a359cec0 100644
--- a/actix-http-test/src/lib.rs
+++ b/actix-http-test/src/lib.rs
@@ -1,7 +1,5 @@
//! Various helpers for Actix applications to use during testing.
-#![deny(rust_2018_idioms, nonstandard_style)]
-#![warn(future_incompatible)]
#![doc(html_logo_url = "https://actix.rs/img/logo.png")]
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
@@ -108,7 +106,7 @@ pub async fn test_server_with_addr>(
builder.set_verify(SslVerifyMode::NONE);
let _ = builder
.set_alpn_protos(b"\x02h2\x08http/1.1")
- .map_err(|e| log::error!("Can not set alpn protocol: {:?}", e));
+ .map_err(|err| log::error!("Can not set ALPN protocol: {err}"));
Connector::new()
.conn_lifetime(Duration::from_secs(0))
diff --git a/actix-http/CHANGES.md b/actix-http/CHANGES.md
index 61eeb4be..982add26 100644
--- a/actix-http/CHANGES.md
+++ b/actix-http/CHANGES.md
@@ -2,6 +2,27 @@
## Unreleased
+### Added
+
+- Add `header::CLEAR_SITE_DATA` constant.
+
+### Changed
+
+- Update `brotli` dependency to `7`.
+- Minimum supported Rust version (MSRV) is now 1.75.
+
+## 3.9.0
+
+### Added
+
+- Implement `FromIterator<(HeaderName, HeaderValue)>` for `HeaderMap`.
+
+## 3.8.0
+
+### Added
+
+- Add `error::InvalidStatusCode` re-export.
+
## 3.7.0
### Added
diff --git a/actix-http/Cargo.toml b/actix-http/Cargo.toml
index c2551713..29420aa8 100644
--- a/actix-http/Cargo.toml
+++ b/actix-http/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "actix-http"
-version = "3.7.0"
+version = "3.9.0"
authors = [
"Nikolay Kim ",
"Rob Ede ",
@@ -34,51 +34,72 @@ features = [
"compress-zstd",
]
-[lib]
-name = "actix_http"
-path = "src/lib.rs"
+[package.metadata.cargo_check_external_types]
+allowed_external_types = [
+ "actix_codec::*",
+ "actix_service::*",
+ "actix_tls::*",
+ "actix_utils::*",
+ "bytes::*",
+ "bytestring::*",
+ "encoding_rs::*",
+ "futures_core::*",
+ "h2::*",
+ "http::*",
+ "httparse::*",
+ "language_tags::*",
+ "mime::*",
+ "openssl::*",
+ "rustls::*",
+ "tokio_util::*",
+ "tokio::*",
+]
[features]
default = []
# HTTP/2 protocol support
-http2 = ["h2"]
+http2 = ["dep:h2"]
# WebSocket protocol implementation
ws = [
- "local-channel",
- "base64",
- "rand",
- "sha1",
+ "dep:local-channel",
+ "dep:base64",
+ "dep:rand",
+ "dep:sha1",
]
# TLS via OpenSSL
-openssl = ["actix-tls/accept", "actix-tls/openssl"]
+openssl = ["__tls", "actix-tls/accept", "actix-tls/openssl"]
# TLS via Rustls v0.20
-rustls = ["rustls-0_20"]
+rustls = ["__tls", "rustls-0_20"]
# TLS via Rustls v0.20
-rustls-0_20 = ["actix-tls/accept", "actix-tls/rustls-0_20"]
+rustls-0_20 = ["__tls", "actix-tls/accept", "actix-tls/rustls-0_20"]
# TLS via Rustls v0.21
-rustls-0_21 = ["actix-tls/accept", "actix-tls/rustls-0_21"]
+rustls-0_21 = ["__tls", "actix-tls/accept", "actix-tls/rustls-0_21"]
# TLS via Rustls v0.22
-rustls-0_22 = ["actix-tls/accept", "actix-tls/rustls-0_22"]
+rustls-0_22 = ["__tls", "actix-tls/accept", "actix-tls/rustls-0_22"]
# TLS via Rustls v0.23
-rustls-0_23 = ["actix-tls/accept", "actix-tls/rustls-0_23"]
+rustls-0_23 = ["__tls", "actix-tls/accept", "actix-tls/rustls-0_23"]
# Compression codecs
-compress-brotli = ["__compress", "brotli"]
-compress-gzip = ["__compress", "flate2"]
-compress-zstd = ["__compress", "zstd"]
+compress-brotli = ["__compress", "dep:brotli"]
+compress-gzip = ["__compress", "dep:flate2"]
+compress-zstd = ["__compress", "dep:zstd"]
# Internal (PRIVATE!) features used to aid testing and checking feature status.
# Don't rely on these whatsoever. They are semver-exempt and may disappear at anytime.
__compress = []
+# Internal (PRIVATE!) features used to aid checking feature status.
+# Don't rely on these whatsoever. They may disappear at anytime.
+__tls = []
+
[dependencies]
actix-service = "2"
actix-codec = "0.5"
@@ -89,7 +110,7 @@ ahash = "0.8"
bitflags = "2"
bytes = "1.7"
bytestring = "1"
-derive_more = "0.99.5"
+derive_more = { version = "1", features = ["as_ref", "deref", "deref_mut", "display", "error", "from"] }
encoding_rs = "0.8"
futures-core = { version = "0.3.17", default-features = false, features = ["alloc"] }
http = "0.2.7"
@@ -106,7 +127,7 @@ tokio-util = { version = "0.7", features = ["io", "codec"] }
tracing = { version = "0.1.30", default-features = false, features = ["log"] }
# http2
-h2 = { version = "0.3.24", optional = true }
+h2 = { version = "0.3.26", optional = true }
# websockets
local-channel = { version = "0.1", optional = true }
@@ -118,7 +139,7 @@ sha1 = { version = "0.10", optional = true }
actix-tls = { version = "3.4", default-features = false, optional = true }
# compress-*
-brotli = { version = "6", optional = true }
+brotli = { version = "7", optional = true }
flate2 = { version = "1.0.13", optional = true }
zstd = { version = "0.13", optional = true }
@@ -139,13 +160,16 @@ rcgen = "0.13"
regex = "1.3"
rustversion = "1"
rustls-pemfile = "2"
-serde = { version = "1.0", features = ["derive"] }
+serde = { version = "1", features = ["derive"] }
serde_json = "1.0"
static_assertions = "1"
tls-openssl = { package = "openssl", version = "0.10.55" }
tls-rustls_023 = { package = "rustls", version = "0.23" }
tokio = { version = "1.24.2", features = ["net", "rt", "macros"] }
+[lints]
+workspace = true
+
[[example]]
name = "ws"
required-features = ["ws", "rustls-0_23"]
diff --git a/actix-http/README.md b/actix-http/README.md
index 0ba3fdca..f78ea86f 100644
--- a/actix-http/README.md
+++ b/actix-http/README.md
@@ -5,11 +5,11 @@
[](https://crates.io/crates/actix-http)
-[](https://docs.rs/actix-http/3.7.0)
+[](https://docs.rs/actix-http/3.9.0)


-[](https://deps.rs/crate/actix-http/3.7.0)
+[](https://deps.rs/crate/actix-http/3.9.0)
[](https://crates.io/crates/actix-http)
[](https://discord.gg/NWpN5mmg3x)
diff --git a/actix-http/examples/actix-web.rs b/actix-http/examples/actix-web.rs
index b1feffbd..68e12301 100644
--- a/actix-http/examples/actix-web.rs
+++ b/actix-http/examples/actix-web.rs
@@ -3,13 +3,13 @@ use std::sync::OnceLock;
use actix_http::HttpService;
use actix_server::Server;
use actix_service::map_config;
-use actix_web::{dev::AppConfig, get, App};
+use actix_web::{dev::AppConfig, get, App, Responder};
static MEDIUM: OnceLock = OnceLock::new();
static LARGE: OnceLock = OnceLock::new();
#[get("/")]
-async fn index() -> &'static str {
+async fn index() -> impl Responder {
"Hello, world. From Actix Web!"
}
diff --git a/actix-http/examples/echo.rs b/actix-http/examples/echo.rs
index ae6f00cc..11fd2750 100644
--- a/actix-http/examples/echo.rs
+++ b/actix-http/examples/echo.rs
@@ -23,7 +23,7 @@ async fn main() -> io::Result<()> {
body.extend_from_slice(&item?);
}
- info!("request body: {:?}", body);
+ info!("request body: {body:?}");
let res = Response::build(StatusCode::OK)
.insert_header(("x-head", HeaderValue::from_static("dummy value!")))
@@ -31,8 +31,7 @@ async fn main() -> io::Result<()> {
Ok::<_, Error>(res)
})
- // No TLS
- .tcp()
+ .tcp() // No TLS
})?
.run()
.await
diff --git a/actix-http/examples/hello-world.rs b/actix-http/examples/hello-world.rs
index cf10bedd..afa3883a 100644
--- a/actix-http/examples/hello-world.rs
+++ b/actix-http/examples/hello-world.rs
@@ -17,7 +17,7 @@ async fn main() -> io::Result<()> {
ext.insert(42u32);
})
.finish(|req: Request| async move {
- info!("{:?}", req);
+ info!("{req:?}");
let mut res = Response::build(StatusCode::OK);
res.insert_header(("x-head", HeaderValue::from_static("dummy value!")));
diff --git a/actix-http/examples/streaming-error.rs b/actix-http/examples/streaming-error.rs
index 8c8a249c..39f214fa 100644
--- a/actix-http/examples/streaming-error.rs
+++ b/actix-http/examples/streaming-error.rs
@@ -22,16 +22,16 @@ async fn main() -> io::Result<()> {
.bind("streaming-error", ("127.0.0.1", 8080), || {
HttpService::build()
.finish(|req| async move {
- info!("{:?}", req);
+ info!("{req:?}");
let res = Response::ok();
Ok::<_, Infallible>(res.set_body(BodyStream::new(stream! {
yield Ok(Bytes::from("123"));
yield Ok(Bytes::from("456"));
- actix_rt::time::sleep(Duration::from_millis(1000)).await;
+ actix_rt::time::sleep(Duration::from_secs(1)).await;
- yield Err(io::Error::new(io::ErrorKind::Other, ""));
+ yield Err(io::Error::new(io::ErrorKind::Other, "abc"));
})))
})
.tcp()
diff --git a/actix-http/examples/ws.rs b/actix-http/examples/ws.rs
index fb86bc5e..af83e4c3 100644
--- a/actix-http/examples/ws.rs
+++ b/actix-http/examples/ws.rs
@@ -17,7 +17,6 @@ use bytes::{Bytes, BytesMut};
use bytestring::ByteString;
use futures_core::{ready, Stream};
use tokio_util::codec::Encoder;
-use tracing::{info, trace};
#[actix_rt::main]
async fn main() -> io::Result<()> {
@@ -37,12 +36,12 @@ async fn main() -> io::Result<()> {
}
async fn handler(req: Request) -> Result>, Error> {
- info!("handshaking");
+ tracing::info!("handshaking");
let mut res = ws::handshake(req.head())?;
// handshake will always fail under HTTP/2
- info!("responding");
+ tracing::info!("responding");
res.message_body(BodyStream::new(Heartbeat::new(ws::Codec::new())))
}
@@ -64,7 +63,7 @@ impl Stream for Heartbeat {
type Item = Result;
fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll