mirror of
https://github.com/fafhrd91/actix-web
synced 2025-07-09 12:26:16 +02:00
Compare commits
46 Commits
web-v4.10.
...
http-v3.11
Author | SHA1 | Date | |
---|---|---|---|
69dda5c943 | |||
1b4b61d839 | |||
2c55d659dd | |||
276f5d5bd4 | |||
5f3c02813a | |||
3d3b31e16a | |||
3147aaccc7 | |||
079400a72b | |||
a49f055561 | |||
55268b6898 | |||
89b5b04653 | |||
e42cffc28d | |||
8765b04476 | |||
40179e2aa6 | |||
9bbb5414d1 | |||
65f254d1b2 | |||
25511dfb38 | |||
6e902d1d5c | |||
f1b7cfb253 | |||
e983276a78 | |||
bbe0134523 | |||
2dd165dc0b | |||
9829f87cd1 | |||
6892896a62 | |||
bdb7b4da2d | |||
7eea3d3657 | |||
ad73cdc823 | |||
e27e1e3806 | |||
5939af88b3 | |||
741ca85d4a | |||
b8a612d21e | |||
74c1c3de59 | |||
6b9c47b0ec | |||
9915defca3 | |||
0ef246a846 | |||
c284426698 | |||
b75ae11e62 | |||
7fddaae878 | |||
52264448cd | |||
90c19a835d | |||
adf57d2b24 | |||
fcd10fbb5e | |||
95b6a81f43 | |||
ab18efe0ac | |||
cede0c6dbb | |||
1005b6a12a |
@ -1,7 +1,8 @@
|
|||||||
disallowed-names = [
|
disallowed-names = [
|
||||||
"e", # no single letter error bindings
|
"..",
|
||||||
|
"e", # no single letter error bindings
|
||||||
]
|
]
|
||||||
disallowed-methods = [
|
disallowed-methods = [
|
||||||
"std::cell::RefCell::default()",
|
{ path = "std::cell::RefCell::default()", reason = "prefer explicit inner type default" },
|
||||||
"std::rc::Rc::default()",
|
{ path = "std::rc::Rc::default()", reason = "prefer explicit inner type default" },
|
||||||
]
|
]
|
||||||
|
12
.cspell.yml
Normal file
12
.cspell.yml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
version: "0.2"
|
||||||
|
words:
|
||||||
|
- actix
|
||||||
|
- addrs
|
||||||
|
- bytestring
|
||||||
|
- httparse
|
||||||
|
- msrv
|
||||||
|
- realip
|
||||||
|
- rustls
|
||||||
|
- rustup
|
||||||
|
- serde
|
||||||
|
- zstd
|
9
.github/dependabot.yml
vendored
9
.github/dependabot.yml
vendored
@ -1,10 +1,11 @@
|
|||||||
version: 2
|
version: 2
|
||||||
updates:
|
updates:
|
||||||
- package-ecosystem: cargo
|
|
||||||
directory: /
|
|
||||||
schedule:
|
|
||||||
interval: weekly
|
|
||||||
- package-ecosystem: github-actions
|
- package-ecosystem: github-actions
|
||||||
directory: /
|
directory: /
|
||||||
schedule:
|
schedule:
|
||||||
interval: weekly
|
interval: weekly
|
||||||
|
- package-ecosystem: cargo
|
||||||
|
directory: /
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
versioning-strategy: lockfile-only
|
||||||
|
8
.github/workflows/ci-post-merge.yml
vendored
8
.github/workflows/ci-post-merge.yml
vendored
@ -44,12 +44,12 @@ jobs:
|
|||||||
echo "RUSTFLAGS=-C target-feature=+crt-static" >> $GITHUB_ENV
|
echo "RUSTFLAGS=-C target-feature=+crt-static" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Install Rust (${{ matrix.version.name }})
|
- name: Install Rust (${{ matrix.version.name }})
|
||||||
uses: actions-rust-lang/setup-rust-toolchain@v1.11.0
|
uses: actions-rust-lang/setup-rust-toolchain@v1.12.0
|
||||||
with:
|
with:
|
||||||
toolchain: ${{ matrix.version.version }}
|
toolchain: ${{ matrix.version.version }}
|
||||||
|
|
||||||
- name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean
|
- name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean
|
||||||
uses: taiki-e/install-action@v2.49.17
|
uses: taiki-e/install-action@v2.50.10
|
||||||
with:
|
with:
|
||||||
tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean
|
tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean
|
||||||
|
|
||||||
@ -80,10 +80,10 @@ jobs:
|
|||||||
uses: rui314/setup-mold@v1
|
uses: rui314/setup-mold@v1
|
||||||
|
|
||||||
- name: Install Rust
|
- name: Install Rust
|
||||||
uses: actions-rust-lang/setup-rust-toolchain@v1.11.0
|
uses: actions-rust-lang/setup-rust-toolchain@v1.12.0
|
||||||
|
|
||||||
- name: Install just, cargo-hack
|
- name: Install just, cargo-hack
|
||||||
uses: taiki-e/install-action@v2.49.17
|
uses: taiki-e/install-action@v2.50.10
|
||||||
with:
|
with:
|
||||||
tool: just,cargo-hack
|
tool: just,cargo-hack
|
||||||
|
|
||||||
|
10
.github/workflows/ci.yml
vendored
10
.github/workflows/ci.yml
vendored
@ -59,12 +59,12 @@ jobs:
|
|||||||
uses: rui314/setup-mold@v1
|
uses: rui314/setup-mold@v1
|
||||||
|
|
||||||
- name: Install Rust (${{ matrix.version.name }})
|
- name: Install Rust (${{ matrix.version.name }})
|
||||||
uses: actions-rust-lang/setup-rust-toolchain@v1.11.0
|
uses: actions-rust-lang/setup-rust-toolchain@v1.12.0
|
||||||
with:
|
with:
|
||||||
toolchain: ${{ matrix.version.version }}
|
toolchain: ${{ matrix.version.version }}
|
||||||
|
|
||||||
- name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean
|
- name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean
|
||||||
uses: taiki-e/install-action@v2.49.17
|
uses: taiki-e/install-action@v2.50.10
|
||||||
with:
|
with:
|
||||||
tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean
|
tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean
|
||||||
|
|
||||||
@ -92,7 +92,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Rust
|
- name: Install Rust
|
||||||
uses: actions-rust-lang/setup-rust-toolchain@v1.11.0
|
uses: actions-rust-lang/setup-rust-toolchain@v1.12.0
|
||||||
with:
|
with:
|
||||||
toolchain: nightly
|
toolchain: nightly
|
||||||
|
|
||||||
@ -108,12 +108,12 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Rust (nightly)
|
- name: Install Rust (nightly)
|
||||||
uses: actions-rust-lang/setup-rust-toolchain@v1.11.0
|
uses: actions-rust-lang/setup-rust-toolchain@v1.12.0
|
||||||
with:
|
with:
|
||||||
toolchain: nightly
|
toolchain: nightly
|
||||||
|
|
||||||
- name: Install just
|
- name: Install just
|
||||||
uses: taiki-e/install-action@v2.49.17
|
uses: taiki-e/install-action@v2.50.10
|
||||||
with:
|
with:
|
||||||
tool: just
|
tool: just
|
||||||
|
|
||||||
|
6
.github/workflows/coverage.yml
vendored
6
.github/workflows/coverage.yml
vendored
@ -18,13 +18,13 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Rust (nightly)
|
- name: Install Rust (nightly)
|
||||||
uses: actions-rust-lang/setup-rust-toolchain@v1.11.0
|
uses: actions-rust-lang/setup-rust-toolchain@v1.12.0
|
||||||
with:
|
with:
|
||||||
toolchain: nightly
|
toolchain: nightly
|
||||||
components: llvm-tools
|
components: llvm-tools
|
||||||
|
|
||||||
- name: Install just, cargo-llvm-cov, cargo-nextest
|
- name: Install just, cargo-llvm-cov, cargo-nextest
|
||||||
uses: taiki-e/install-action@v2.49.17
|
uses: taiki-e/install-action@v2.50.10
|
||||||
with:
|
with:
|
||||||
tool: just,cargo-llvm-cov,cargo-nextest
|
tool: just,cargo-llvm-cov,cargo-nextest
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ jobs:
|
|||||||
run: just test-coverage-codecov
|
run: just test-coverage-codecov
|
||||||
|
|
||||||
- name: Upload coverage to Codecov
|
- name: Upload coverage to Codecov
|
||||||
uses: codecov/codecov-action@v5.4.0
|
uses: codecov/codecov-action@v5.4.2
|
||||||
with:
|
with:
|
||||||
files: codecov.json
|
files: codecov.json
|
||||||
fail_ci_if_error: true
|
fail_ci_if_error: true
|
||||||
|
10
.github/workflows/lint.yml
vendored
10
.github/workflows/lint.yml
vendored
@ -18,7 +18,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Rust (nightly)
|
- name: Install Rust (nightly)
|
||||||
uses: actions-rust-lang/setup-rust-toolchain@v1.11.0
|
uses: actions-rust-lang/setup-rust-toolchain@v1.12.0
|
||||||
with:
|
with:
|
||||||
toolchain: nightly
|
toolchain: nightly
|
||||||
components: rustfmt
|
components: rustfmt
|
||||||
@ -36,7 +36,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Rust
|
- name: Install Rust
|
||||||
uses: actions-rust-lang/setup-rust-toolchain@v1.11.0
|
uses: actions-rust-lang/setup-rust-toolchain@v1.12.0
|
||||||
with:
|
with:
|
||||||
components: clippy
|
components: clippy
|
||||||
|
|
||||||
@ -55,7 +55,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Rust (nightly)
|
- name: Install Rust (nightly)
|
||||||
uses: actions-rust-lang/setup-rust-toolchain@v1.11.0
|
uses: actions-rust-lang/setup-rust-toolchain@v1.12.0
|
||||||
with:
|
with:
|
||||||
toolchain: nightly
|
toolchain: nightly
|
||||||
components: rust-docs
|
components: rust-docs
|
||||||
@ -72,12 +72,12 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Rust (${{ vars.RUST_VERSION_EXTERNAL_TYPES }})
|
- name: Install Rust (${{ vars.RUST_VERSION_EXTERNAL_TYPES }})
|
||||||
uses: actions-rust-lang/setup-rust-toolchain@v1.11.0
|
uses: actions-rust-lang/setup-rust-toolchain@v1.12.0
|
||||||
with:
|
with:
|
||||||
toolchain: ${{ vars.RUST_VERSION_EXTERNAL_TYPES }}
|
toolchain: ${{ vars.RUST_VERSION_EXTERNAL_TYPES }}
|
||||||
|
|
||||||
- name: Install just
|
- name: Install just
|
||||||
uses: taiki-e/install-action@v2.49.17
|
uses: taiki-e/install-action@v2.50.10
|
||||||
with:
|
with:
|
||||||
tool: just
|
tool: just
|
||||||
|
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,4 +1,3 @@
|
|||||||
Cargo.lock
|
|
||||||
target/
|
target/
|
||||||
guide/build/
|
guide/build/
|
||||||
/gh-pages
|
/gh-pages
|
||||||
|
38
.taplo.toml
Normal file
38
.taplo.toml
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
exclude = ["target/*"]
|
||||||
|
include = ["**/*.toml"]
|
||||||
|
|
||||||
|
[formatting]
|
||||||
|
column_width = 100
|
||||||
|
align_comments = false
|
||||||
|
|
||||||
|
[[rule]]
|
||||||
|
include = ["**/Cargo.toml"]
|
||||||
|
keys = ["features"]
|
||||||
|
formatting.column_width = 105
|
||||||
|
formatting.reorder_keys = false
|
||||||
|
|
||||||
|
[[rule]]
|
||||||
|
include = ["**/Cargo.toml"]
|
||||||
|
keys = [
|
||||||
|
"dependencies",
|
||||||
|
"*-dependencies",
|
||||||
|
"workspace.dependencies",
|
||||||
|
"workspace.*-dependencies",
|
||||||
|
"target.*.dependencies",
|
||||||
|
"target.*.*-dependencies",
|
||||||
|
]
|
||||||
|
formatting.column_width = 120
|
||||||
|
formatting.reorder_keys = true
|
||||||
|
|
||||||
|
[[rule]]
|
||||||
|
include = ["**/Cargo.toml"]
|
||||||
|
keys = [
|
||||||
|
"dependencies.*",
|
||||||
|
"*-dependencies.*",
|
||||||
|
"workspace.dependencies.*",
|
||||||
|
"workspace.*-dependencies.*",
|
||||||
|
"target.*.dependencies",
|
||||||
|
"target.*.*-dependencies",
|
||||||
|
]
|
||||||
|
formatting.column_width = 120
|
||||||
|
formatting.reorder_keys = false
|
3957
Cargo.lock
generated
Normal file
3957
Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
22
Cargo.toml
22
Cargo.toml
@ -1,17 +1,17 @@
|
|||||||
[workspace]
|
[workspace]
|
||||||
resolver = "2"
|
resolver = "2"
|
||||||
members = [
|
members = [
|
||||||
"actix-files",
|
"actix-files",
|
||||||
"actix-http-test",
|
"actix-http-test",
|
||||||
"actix-http",
|
"actix-http",
|
||||||
"actix-multipart",
|
"actix-multipart",
|
||||||
"actix-multipart-derive",
|
"actix-multipart-derive",
|
||||||
"actix-router",
|
"actix-router",
|
||||||
"actix-test",
|
"actix-test",
|
||||||
"actix-web-actors",
|
"actix-web-actors",
|
||||||
"actix-web-codegen",
|
"actix-web-codegen",
|
||||||
"actix-web",
|
"actix-web",
|
||||||
"awc",
|
"awc",
|
||||||
]
|
]
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "actix-files"
|
name = "actix-files"
|
||||||
version = "0.6.6"
|
version = "0.6.6"
|
||||||
authors = [
|
authors = ["Nikolay Kim <fafhrd91@gmail.com>", "Rob Ede <robjtede@icloud.com>"]
|
||||||
"Nikolay Kim <fafhrd91@gmail.com>",
|
|
||||||
"Rob Ede <robjtede@icloud.com>",
|
|
||||||
]
|
|
||||||
description = "Static file serving for Actix Web"
|
description = "Static file serving for Actix Web"
|
||||||
keywords = ["actix", "http", "async", "futures"]
|
keywords = ["actix", "http", "async", "futures"]
|
||||||
homepage = "https://actix.rs"
|
homepage = "https://actix.rs"
|
||||||
@ -14,13 +11,7 @@ license = "MIT OR Apache-2.0"
|
|||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[package.metadata.cargo_check_external_types]
|
[package.metadata.cargo_check_external_types]
|
||||||
allowed_external_types = [
|
allowed_external_types = ["actix_http::*", "actix_service::*", "actix_web::*", "http::*", "mime::*"]
|
||||||
"actix_http::*",
|
|
||||||
"actix_service::*",
|
|
||||||
"actix_web::*",
|
|
||||||
"http::*",
|
|
||||||
"mime::*",
|
|
||||||
]
|
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
experimental-io-uring = ["actix-web/experimental-io-uring", "tokio-uring"]
|
experimental-io-uring = ["actix-web/experimental-io-uring", "tokio-uring"]
|
||||||
@ -46,7 +37,7 @@ v_htmlescape = "0.15.5"
|
|||||||
# experimental-io-uring
|
# experimental-io-uring
|
||||||
[target.'cfg(target_os = "linux")'.dependencies]
|
[target.'cfg(target_os = "linux")'.dependencies]
|
||||||
tokio-uring = { version = "0.5", optional = true, features = ["bytes"] }
|
tokio-uring = { version = "0.5", optional = true, features = ["bytes"] }
|
||||||
actix-server = { version = "2.4", optional = true } # ensure matching tokio-uring versions
|
actix-server = { version = "2.4", optional = true } # ensure matching tokio-uring versions
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
actix-rt = "2.7"
|
actix-rt = "2.7"
|
||||||
|
@ -7,10 +7,10 @@ keywords = ["http", "web", "framework", "async", "futures"]
|
|||||||
homepage = "https://actix.rs"
|
homepage = "https://actix.rs"
|
||||||
repository = "https://github.com/actix/actix-web"
|
repository = "https://github.com/actix/actix-web"
|
||||||
categories = [
|
categories = [
|
||||||
"network-programming",
|
"network-programming",
|
||||||
"asynchronous",
|
"asynchronous",
|
||||||
"web-programming::http-server",
|
"web-programming::http-server",
|
||||||
"web-programming::websocket",
|
"web-programming::websocket",
|
||||||
]
|
]
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
@ -20,14 +20,14 @@ features = []
|
|||||||
|
|
||||||
[package.metadata.cargo_check_external_types]
|
[package.metadata.cargo_check_external_types]
|
||||||
allowed_external_types = [
|
allowed_external_types = [
|
||||||
"actix_codec::*",
|
"actix_codec::*",
|
||||||
"actix_http::*",
|
"actix_http::*",
|
||||||
"actix_server::*",
|
"actix_server::*",
|
||||||
"awc::*",
|
"awc::*",
|
||||||
"bytes::*",
|
"bytes::*",
|
||||||
"futures_core::*",
|
"futures_core::*",
|
||||||
"http::*",
|
"http::*",
|
||||||
"tokio::*",
|
"tokio::*",
|
||||||
]
|
]
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
@ -37,25 +37,25 @@ default = []
|
|||||||
openssl = ["tls-openssl", "awc/openssl"]
|
openssl = ["tls-openssl", "awc/openssl"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
actix-service = "2"
|
|
||||||
actix-codec = "0.5"
|
actix-codec = "0.5"
|
||||||
actix-tls = "3"
|
|
||||||
actix-utils = "3"
|
|
||||||
actix-rt = "2.2"
|
actix-rt = "2.2"
|
||||||
actix-server = "2"
|
actix-server = "2"
|
||||||
|
actix-service = "2"
|
||||||
|
actix-tls = "3"
|
||||||
|
actix-utils = "3"
|
||||||
awc = { version = "3", default-features = false }
|
awc = { version = "3", default-features = false }
|
||||||
|
|
||||||
bytes = "1"
|
bytes = "1"
|
||||||
futures-core = { version = "0.3.17", default-features = false }
|
futures-core = { version = "0.3.17", default-features = false }
|
||||||
http = "0.2.7"
|
http = "0.2.7"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
socket2 = "0.5"
|
|
||||||
serde = "1"
|
serde = "1"
|
||||||
serde_json = "1"
|
serde_json = "1"
|
||||||
slab = "0.4"
|
|
||||||
serde_urlencoded = "0.7"
|
serde_urlencoded = "0.7"
|
||||||
|
slab = "0.4"
|
||||||
|
socket2 = "0.5"
|
||||||
tls-openssl = { version = "0.10.55", package = "openssl", optional = true }
|
tls-openssl = { version = "0.10.55", package = "openssl", optional = true }
|
||||||
tokio = { version = "1.24.2", features = ["sync"] }
|
tokio = { version = "1.38.2", features = ["sync"] }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
actix-http = "3"
|
actix-http = "3"
|
||||||
|
@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
## 3.11.0
|
||||||
|
|
||||||
|
- Update `brotli` dependency to `8`.
|
||||||
|
|
||||||
## 3.10.0
|
## 3.10.0
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
@ -1,19 +1,16 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "actix-http"
|
name = "actix-http"
|
||||||
version = "3.10.0"
|
version = "3.11.0"
|
||||||
authors = [
|
authors = ["Nikolay Kim <fafhrd91@gmail.com>", "Rob Ede <robjtede@icloud.com>"]
|
||||||
"Nikolay Kim <fafhrd91@gmail.com>",
|
|
||||||
"Rob Ede <robjtede@icloud.com>",
|
|
||||||
]
|
|
||||||
description = "HTTP types and services for the Actix ecosystem"
|
description = "HTTP types and services for the Actix ecosystem"
|
||||||
keywords = ["actix", "http", "framework", "async", "futures"]
|
keywords = ["actix", "http", "framework", "async", "futures"]
|
||||||
homepage = "https://actix.rs"
|
homepage = "https://actix.rs"
|
||||||
repository = "https://github.com/actix/actix-web"
|
repository = "https://github.com/actix/actix-web"
|
||||||
categories = [
|
categories = [
|
||||||
"network-programming",
|
"network-programming",
|
||||||
"asynchronous",
|
"asynchronous",
|
||||||
"web-programming::http-server",
|
"web-programming::http-server",
|
||||||
"web-programming::websocket",
|
"web-programming::websocket",
|
||||||
]
|
]
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
@ -22,37 +19,37 @@ rust-version.workspace = true
|
|||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
rustdoc-args = ["--cfg", "docsrs"]
|
rustdoc-args = ["--cfg", "docsrs"]
|
||||||
features = [
|
features = [
|
||||||
"http2",
|
"http2",
|
||||||
"ws",
|
"ws",
|
||||||
"openssl",
|
"openssl",
|
||||||
"rustls-0_20",
|
"rustls-0_20",
|
||||||
"rustls-0_21",
|
"rustls-0_21",
|
||||||
"rustls-0_22",
|
"rustls-0_22",
|
||||||
"rustls-0_23",
|
"rustls-0_23",
|
||||||
"compress-brotli",
|
"compress-brotli",
|
||||||
"compress-gzip",
|
"compress-gzip",
|
||||||
"compress-zstd",
|
"compress-zstd",
|
||||||
]
|
]
|
||||||
|
|
||||||
[package.metadata.cargo_check_external_types]
|
[package.metadata.cargo_check_external_types]
|
||||||
allowed_external_types = [
|
allowed_external_types = [
|
||||||
"actix_codec::*",
|
"actix_codec::*",
|
||||||
"actix_service::*",
|
"actix_service::*",
|
||||||
"actix_tls::*",
|
"actix_tls::*",
|
||||||
"actix_utils::*",
|
"actix_utils::*",
|
||||||
"bytes::*",
|
"bytes::*",
|
||||||
"bytestring::*",
|
"bytestring::*",
|
||||||
"encoding_rs::*",
|
"encoding_rs::*",
|
||||||
"futures_core::*",
|
"futures_core::*",
|
||||||
"h2::*",
|
"h2::*",
|
||||||
"http::*",
|
"http::*",
|
||||||
"httparse::*",
|
"httparse::*",
|
||||||
"language_tags::*",
|
"language_tags::*",
|
||||||
"mime::*",
|
"mime::*",
|
||||||
"openssl::*",
|
"openssl::*",
|
||||||
"rustls::*",
|
"rustls::*",
|
||||||
"tokio_util::*",
|
"tokio_util::*",
|
||||||
"tokio::*",
|
"tokio::*",
|
||||||
]
|
]
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
@ -62,12 +59,7 @@ default = []
|
|||||||
http2 = ["dep:h2"]
|
http2 = ["dep:h2"]
|
||||||
|
|
||||||
# WebSocket protocol implementation
|
# WebSocket protocol implementation
|
||||||
ws = [
|
ws = ["dep:local-channel", "dep:base64", "dep:rand", "dep:sha1"]
|
||||||
"dep:local-channel",
|
|
||||||
"dep:base64",
|
|
||||||
"dep:rand",
|
|
||||||
"dep:sha1",
|
|
||||||
]
|
|
||||||
|
|
||||||
# TLS via OpenSSL
|
# TLS via OpenSSL
|
||||||
openssl = ["__tls", "actix-tls/accept", "actix-tls/openssl"]
|
openssl = ["__tls", "actix-tls/accept", "actix-tls/openssl"]
|
||||||
@ -89,8 +81,8 @@ rustls-0_23 = ["__tls", "actix-tls/accept", "actix-tls/rustls-0_23"]
|
|||||||
|
|
||||||
# Compression codecs
|
# Compression codecs
|
||||||
compress-brotli = ["__compress", "dep:brotli"]
|
compress-brotli = ["__compress", "dep:brotli"]
|
||||||
compress-gzip = ["__compress", "dep:flate2"]
|
compress-gzip = ["__compress", "dep:flate2"]
|
||||||
compress-zstd = ["__compress", "dep:zstd"]
|
compress-zstd = ["__compress", "dep:zstd"]
|
||||||
|
|
||||||
# Internal (PRIVATE!) features used to aid testing and checking feature status.
|
# 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.
|
# Don't rely on these whatsoever. They are semver-exempt and may disappear at anytime.
|
||||||
@ -101,10 +93,10 @@ __compress = []
|
|||||||
__tls = []
|
__tls = []
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
actix-service = "2"
|
|
||||||
actix-codec = "0.5"
|
actix-codec = "0.5"
|
||||||
actix-utils = "3"
|
|
||||||
actix-rt = { version = "2.2", default-features = false }
|
actix-rt = { version = "2.2", default-features = false }
|
||||||
|
actix-service = "2"
|
||||||
|
actix-utils = "3"
|
||||||
|
|
||||||
bitflags = "2"
|
bitflags = "2"
|
||||||
bytes = "1"
|
bytes = "1"
|
||||||
@ -122,7 +114,7 @@ mime = "0.3.4"
|
|||||||
percent-encoding = "2.1"
|
percent-encoding = "2.1"
|
||||||
pin-project-lite = "0.2"
|
pin-project-lite = "0.2"
|
||||||
smallvec = "1.6.1"
|
smallvec = "1.6.1"
|
||||||
tokio = { version = "1.24.2", features = [] }
|
tokio = { version = "1.38.2", features = [] }
|
||||||
tokio-util = { version = "0.7", features = ["io", "codec"] }
|
tokio-util = { version = "0.7", features = ["io", "codec"] }
|
||||||
tracing = { version = "0.1.30", default-features = false, features = ["log"] }
|
tracing = { version = "0.1.30", default-features = false, features = ["log"] }
|
||||||
|
|
||||||
@ -130,8 +122,8 @@ tracing = { version = "0.1.30", default-features = false, features = ["log"] }
|
|||||||
h2 = { version = "0.3.26", optional = true }
|
h2 = { version = "0.3.26", optional = true }
|
||||||
|
|
||||||
# websockets
|
# websockets
|
||||||
local-channel = { version = "0.1", optional = true }
|
|
||||||
base64 = { version = "0.22", optional = true }
|
base64 = { version = "0.22", optional = true }
|
||||||
|
local-channel = { version = "0.1", optional = true }
|
||||||
rand = { version = "0.9", optional = true }
|
rand = { version = "0.9", optional = true }
|
||||||
sha1 = { version = "0.10", optional = true }
|
sha1 = { version = "0.10", optional = true }
|
||||||
|
|
||||||
@ -139,7 +131,7 @@ sha1 = { version = "0.10", optional = true }
|
|||||||
actix-tls = { version = "3.4", default-features = false, optional = true }
|
actix-tls = { version = "3.4", default-features = false, optional = true }
|
||||||
|
|
||||||
# compress-*
|
# compress-*
|
||||||
brotli = { version = "7", optional = true }
|
brotli = { version = "8", optional = true }
|
||||||
flate2 = { version = "1.0.13", optional = true }
|
flate2 = { version = "1.0.13", optional = true }
|
||||||
zstd = { version = "0.13", optional = true }
|
zstd = { version = "0.13", optional = true }
|
||||||
|
|
||||||
@ -155,17 +147,17 @@ divan = "0.1.8"
|
|||||||
env_logger = "0.11"
|
env_logger = "0.11"
|
||||||
futures-util = { version = "0.3.17", default-features = false, features = ["alloc"] }
|
futures-util = { version = "0.3.17", default-features = false, features = ["alloc"] }
|
||||||
memchr = "2.4"
|
memchr = "2.4"
|
||||||
once_cell = "1.9"
|
once_cell = "1.21"
|
||||||
rcgen = "0.13"
|
rcgen = "0.13"
|
||||||
regex = "1.3"
|
regex = "1.3"
|
||||||
rustversion = "1"
|
|
||||||
rustls-pemfile = "2"
|
rustls-pemfile = "2"
|
||||||
|
rustversion = "1"
|
||||||
serde = { version = "1", features = ["derive"] }
|
serde = { version = "1", features = ["derive"] }
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
static_assertions = "1"
|
static_assertions = "1"
|
||||||
tls-openssl = { package = "openssl", version = "0.10.55" }
|
tls-openssl = { package = "openssl", version = "0.10.55" }
|
||||||
tls-rustls_023 = { package = "rustls", version = "0.23" }
|
tls-rustls_023 = { package = "rustls", version = "0.23" }
|
||||||
tokio = { version = "1.24.2", features = ["net", "rt", "macros"] }
|
tokio = { version = "1.38.2", features = ["net", "rt", "macros"] }
|
||||||
|
|
||||||
[lints]
|
[lints]
|
||||||
workspace = true
|
workspace = true
|
||||||
|
@ -5,11 +5,11 @@
|
|||||||
<!-- prettier-ignore-start -->
|
<!-- prettier-ignore-start -->
|
||||||
|
|
||||||
[](https://crates.io/crates/actix-http)
|
[](https://crates.io/crates/actix-http)
|
||||||
[](https://docs.rs/actix-http/3.10.0)
|
[](https://docs.rs/actix-http/3.11.0)
|
||||||

|

|
||||||

|

|
||||||
<br />
|
<br />
|
||||||
[](https://deps.rs/crate/actix-http/3.10.0)
|
[](https://deps.rs/crate/actix-http/3.11.0)
|
||||||
[](https://crates.io/crates/actix-http)
|
[](https://crates.io/crates/actix-http)
|
||||||
[](https://discord.gg/NWpN5mmg3x)
|
[](https://discord.gg/NWpN5mmg3x)
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ async fn main() -> io::Result<()> {
|
|||||||
|
|
||||||
actix_rt::time::sleep(Duration::from_secs(1)).await;
|
actix_rt::time::sleep(Duration::from_secs(1)).await;
|
||||||
|
|
||||||
yield Err(io::Error::new(io::ErrorKind::Other, "abc"));
|
yield Err(io::Error::other("abc"));
|
||||||
})))
|
})))
|
||||||
})
|
})
|
||||||
.tcp()
|
.tcp()
|
||||||
|
@ -190,7 +190,7 @@ mod tests {
|
|||||||
|
|
||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
async fn to_body_limit_error() {
|
async fn to_body_limit_error() {
|
||||||
let err_stream = stream::once(async { Err(io::Error::new(io::ErrorKind::Other, "")) });
|
let err_stream = stream::once(async { Err(io::Error::other("")) });
|
||||||
let body = SizedStream::new(8, err_stream);
|
let body = SizedStream::new(8, err_stream);
|
||||||
// not too big, but propagates error from body stream
|
// not too big, but propagates error from body stream
|
||||||
assert!(to_bytes_limited(body, 10).await.unwrap().is_err());
|
assert!(to_bytes_limited(body, 10).await.unwrap().is_err());
|
||||||
|
@ -100,10 +100,7 @@ where
|
|||||||
loop {
|
loop {
|
||||||
if let Some(ref mut fut) = this.fut {
|
if let Some(ref mut fut) = this.fut {
|
||||||
let (chunk, decoder) = ready!(Pin::new(fut).poll(cx)).map_err(|_| {
|
let (chunk, decoder) = ready!(Pin::new(fut).poll(cx)).map_err(|_| {
|
||||||
PayloadError::Io(io::Error::new(
|
PayloadError::Io(io::Error::other("Blocking task was cancelled unexpectedly"))
|
||||||
io::ErrorKind::Other,
|
|
||||||
"Blocking task was cancelled unexpectedly",
|
|
||||||
))
|
|
||||||
})??;
|
})??;
|
||||||
|
|
||||||
*this.decoder = Some(decoder);
|
*this.decoder = Some(decoder);
|
||||||
|
@ -183,8 +183,7 @@ where
|
|||||||
if let Some(ref mut fut) = this.fut {
|
if let Some(ref mut fut) = this.fut {
|
||||||
let mut encoder = ready!(Pin::new(fut).poll(cx))
|
let mut encoder = ready!(Pin::new(fut).poll(cx))
|
||||||
.map_err(|_| {
|
.map_err(|_| {
|
||||||
EncoderError::Io(io::Error::new(
|
EncoderError::Io(io::Error::other(
|
||||||
io::ErrorKind::Other,
|
|
||||||
"Blocking task was cancelled unexpectedly",
|
"Blocking task was cancelled unexpectedly",
|
||||||
))
|
))
|
||||||
})?
|
})?
|
||||||
|
@ -415,7 +415,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_as_response() {
|
fn test_as_response() {
|
||||||
let orig = io::Error::new(io::ErrorKind::Other, "other");
|
let orig = io::Error::other("other");
|
||||||
let err: Error = ParseError::Io(orig).into();
|
let err: Error = ParseError::Io(orig).into();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
format!("{}", err),
|
format!("{}", err),
|
||||||
@ -425,14 +425,14 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_error_display() {
|
fn test_error_display() {
|
||||||
let orig = io::Error::new(io::ErrorKind::Other, "other");
|
let orig = io::Error::other("other");
|
||||||
let err = Error::new_io().with_cause(orig);
|
let err = Error::new_io().with_cause(orig);
|
||||||
assert_eq!("connection error: other", err.to_string());
|
assert_eq!("connection error: other", err.to_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_error_http_response() {
|
fn test_error_http_response() {
|
||||||
let orig = io::Error::new(io::ErrorKind::Other, "other");
|
let orig = io::Error::other("other");
|
||||||
let err = Error::new_io().with_cause(orig);
|
let err = Error::new_io().with_cause(orig);
|
||||||
let resp: Response<BoxBody> = err.into();
|
let resp: Response<BoxBody> = err.into();
|
||||||
assert_eq!(resp.status(), StatusCode::INTERNAL_SERVER_ERROR);
|
assert_eq!(resp.status(), StatusCode::INTERNAL_SERVER_ERROR);
|
||||||
@ -440,7 +440,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_payload_error() {
|
fn test_payload_error() {
|
||||||
let err: PayloadError = io::Error::new(io::ErrorKind::Other, "ParseError").into();
|
let err: PayloadError = io::Error::other("ParseError").into();
|
||||||
assert!(err.to_string().contains("ParseError"));
|
assert!(err.to_string().contains("ParseError"));
|
||||||
|
|
||||||
let err = PayloadError::Incomplete(None);
|
let err = PayloadError::Incomplete(None);
|
||||||
@ -475,7 +475,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_from() {
|
fn test_from() {
|
||||||
from_and_cause!(io::Error::new(io::ErrorKind::Other, "other") => ParseError::Io(..));
|
from_and_cause!(io::Error::other("other") => ParseError::Io(..));
|
||||||
from!(httparse::Error::HeaderName => ParseError::Header);
|
from!(httparse::Error::HeaderName => ParseError::Header);
|
||||||
from!(httparse::Error::HeaderName => ParseError::Header);
|
from!(httparse::Error::HeaderName => ParseError::Header);
|
||||||
from!(httparse::Error::HeaderValue => ParseError::Header);
|
from!(httparse::Error::HeaderValue => ParseError::Header);
|
||||||
|
@ -310,10 +310,10 @@ impl MessageType for RequestHeadType {
|
|||||||
Version::HTTP_11 => "HTTP/1.1",
|
Version::HTTP_11 => "HTTP/1.1",
|
||||||
Version::HTTP_2 => "HTTP/2.0",
|
Version::HTTP_2 => "HTTP/2.0",
|
||||||
Version::HTTP_3 => "HTTP/3.0",
|
Version::HTTP_3 => "HTTP/3.0",
|
||||||
_ => return Err(io::Error::new(io::ErrorKind::Other, "unsupported version")),
|
_ => return Err(io::Error::other("Unsupported version")),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.map_err(|err| io::Error::new(io::ErrorKind::Other, err))
|
.map_err(io::Error::other)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -433,7 +433,7 @@ impl TransferEncoding {
|
|||||||
buf.extend_from_slice(b"0\r\n\r\n");
|
buf.extend_from_slice(b"0\r\n\r\n");
|
||||||
} else {
|
} else {
|
||||||
writeln!(helpers::MutWriter(buf), "{:X}\r", msg.len())
|
writeln!(helpers::MutWriter(buf), "{:X}\r", msg.len())
|
||||||
.map_err(|err| io::Error::new(io::ErrorKind::Other, err))?;
|
.map_err(io::Error::other)?;
|
||||||
|
|
||||||
buf.reserve(msg.len() + 2);
|
buf.reserve(msg.len() + 2);
|
||||||
buf.extend_from_slice(msg);
|
buf.extend_from_slice(msg);
|
||||||
|
@ -18,8 +18,8 @@ all-features = true
|
|||||||
proc-macro = true
|
proc-macro = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
bytesize = "2"
|
||||||
darling = "0.20"
|
darling = "0.20"
|
||||||
parse-size = "1"
|
|
||||||
proc-macro2 = "1"
|
proc-macro2 = "1"
|
||||||
quote = "1"
|
quote = "1"
|
||||||
syn = "2"
|
syn = "2"
|
||||||
@ -27,7 +27,7 @@ syn = "2"
|
|||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
actix-multipart = "0.7"
|
actix-multipart = "0.7"
|
||||||
actix-web = "4"
|
actix-web = "4"
|
||||||
rustversion = "1"
|
rustversion-msrv = "0.100"
|
||||||
trybuild = "1"
|
trybuild = "1"
|
||||||
|
|
||||||
[lints]
|
[lints]
|
||||||
|
@ -9,8 +9,8 @@
|
|||||||
|
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
|
|
||||||
|
use bytesize::ByteSize;
|
||||||
use darling::{FromDeriveInput, FromField, FromMeta};
|
use darling::{FromDeriveInput, FromField, FromMeta};
|
||||||
use parse_size::parse_size;
|
|
||||||
use proc_macro::TokenStream;
|
use proc_macro::TokenStream;
|
||||||
use proc_macro2::Ident;
|
use proc_macro2::Ident;
|
||||||
use quote::quote;
|
use quote::quote;
|
||||||
@ -103,7 +103,7 @@ struct ParsedField<'t> {
|
|||||||
/// # Field Limits
|
/// # Field Limits
|
||||||
///
|
///
|
||||||
/// You can use the `#[multipart(limit = "<size>")]` attribute to set field level limits. The limit
|
/// You can use the `#[multipart(limit = "<size>")]` attribute to set field level limits. The limit
|
||||||
/// string is parsed using [parse_size].
|
/// string is parsed using [`bytesize`].
|
||||||
///
|
///
|
||||||
/// Note: the form is also subject to the global limits configured using `MultipartFormConfig`.
|
/// Note: the form is also subject to the global limits configured using `MultipartFormConfig`.
|
||||||
///
|
///
|
||||||
@ -150,7 +150,7 @@ struct ParsedField<'t> {
|
|||||||
/// struct Form { }
|
/// struct Form { }
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// [parse_size]: https://docs.rs/parse-size/1/parse_size
|
/// [`bytesize`]: https://docs.rs/bytesize/2
|
||||||
#[proc_macro_derive(MultipartForm, attributes(multipart))]
|
#[proc_macro_derive(MultipartForm, attributes(multipart))]
|
||||||
pub fn impl_multipart_form(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
|
pub fn impl_multipart_form(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
|
||||||
let input: syn::DeriveInput = parse_macro_input!(input);
|
let input: syn::DeriveInput = parse_macro_input!(input);
|
||||||
@ -191,8 +191,8 @@ pub fn impl_multipart_form(input: proc_macro::TokenStream) -> proc_macro::TokenS
|
|||||||
let attrs = FieldAttrs::from_field(field).map_err(|err| err.write_errors())?;
|
let attrs = FieldAttrs::from_field(field).map_err(|err| err.write_errors())?;
|
||||||
let serialization_name = attrs.rename.unwrap_or_else(|| rust_name.to_string());
|
let serialization_name = attrs.rename.unwrap_or_else(|| rust_name.to_string());
|
||||||
|
|
||||||
let limit = match attrs.limit.map(|limit| match parse_size(&limit) {
|
let limit = match attrs.limit.map(|limit| match limit.parse::<ByteSize>() {
|
||||||
Ok(size) => Ok(usize::try_from(size).unwrap()),
|
Ok(ByteSize(size)) => Ok(usize::try_from(size).unwrap()),
|
||||||
Err(err) => Err(syn::Error::new(
|
Err(err) => Err(syn::Error::new(
|
||||||
field.ident.as_ref().unwrap().span(),
|
field.ident.as_ref().unwrap().span(),
|
||||||
format!("Could not parse size limit `{}`: {}", limit, err),
|
format!("Could not parse size limit `{}`: {}", limit, err),
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#[rustversion::stable(1.72)] // MSRV
|
#[rustversion_msrv::msrv]
|
||||||
#[test]
|
#[test]
|
||||||
fn compile_macros() {
|
fn compile_macros() {
|
||||||
let t = trybuild::TestCases::new();
|
let t = trybuild::TestCases::new();
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
error: Could not parse size limit `2 bytes`: invalid digit found in string
|
error: Could not parse size limit `2 bytes`: couldn't parse "bytes" into a known SI unit, couldn't parse unit of "bytes"
|
||||||
--> tests/trybuild/size-limit-parse-fail.rs:6:5
|
--> tests/trybuild/size-limit-parse-fail.rs:6:5
|
||||||
|
|
|
|
||||||
6 | description: Text<String>,
|
6 | description: Text<String>,
|
||||||
| ^^^^^^^^^^^
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
error: Could not parse size limit `2 megabytes`: invalid digit found in string
|
error: Could not parse size limit `2 megabytes`: couldn't parse "megabytes" into a known SI unit, couldn't parse unit of "megabytes"
|
||||||
--> tests/trybuild/size-limit-parse-fail.rs:12:5
|
--> tests/trybuild/size-limit-parse-fail.rs:12:5
|
||||||
|
|
|
|
||||||
12 | description: Text<String>,
|
12 | description: Text<String>,
|
||||||
| ^^^^^^^^^^^
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
error: Could not parse size limit `four meters`: invalid digit found in string
|
error: Could not parse size limit `four meters`: couldn't parse "four meters" into a ByteSize, cannot parse float from empty string
|
||||||
--> tests/trybuild/size-limit-parse-fail.rs:18:5
|
--> tests/trybuild/size-limit-parse-fail.rs:18:5
|
||||||
|
|
|
|
||||||
18 | description: Text<String>,
|
18 | description: Text<String>,
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
name = "actix-multipart"
|
name = "actix-multipart"
|
||||||
version = "0.7.2"
|
version = "0.7.2"
|
||||||
authors = [
|
authors = [
|
||||||
"Nikolay Kim <fafhrd91@gmail.com>",
|
"Nikolay Kim <fafhrd91@gmail.com>",
|
||||||
"Jacob Halsey <jacob@jhalsey.com>",
|
"Jacob Halsey <jacob@jhalsey.com>",
|
||||||
"Rob Ede <robjtede@icloud.com>",
|
"Rob Ede <robjtede@icloud.com>",
|
||||||
]
|
]
|
||||||
description = "Multipart request & form support for Actix Web"
|
description = "Multipart request & form support for Actix Web"
|
||||||
keywords = ["http", "actix", "web", "multipart", "form"]
|
keywords = ["http", "actix", "web", "multipart", "form"]
|
||||||
@ -19,17 +19,17 @@ all-features = true
|
|||||||
|
|
||||||
[package.metadata.cargo_check_external_types]
|
[package.metadata.cargo_check_external_types]
|
||||||
allowed_external_types = [
|
allowed_external_types = [
|
||||||
"actix_http::*",
|
"actix_http::*",
|
||||||
"actix_multipart_derive::*",
|
"actix_multipart_derive::*",
|
||||||
"actix_utils::*",
|
"actix_utils::*",
|
||||||
"actix_web::*",
|
"actix_web::*",
|
||||||
"bytes::*",
|
"bytes::*",
|
||||||
"futures_core::*",
|
"futures_core::*",
|
||||||
"mime::*",
|
"mime::*",
|
||||||
"serde_json::*",
|
"serde_json::*",
|
||||||
"serde_plain::*",
|
"serde_plain::*",
|
||||||
"serde::*",
|
"serde::*",
|
||||||
"tempfile::*",
|
"tempfile::*",
|
||||||
]
|
]
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
@ -55,7 +55,7 @@ serde = "1"
|
|||||||
serde_json = "1"
|
serde_json = "1"
|
||||||
serde_plain = "1"
|
serde_plain = "1"
|
||||||
tempfile = { version = "3.4", optional = true }
|
tempfile = { version = "3.4", optional = true }
|
||||||
tokio = { version = "1.24.2", features = ["sync", "io-util"] }
|
tokio = { version = "1.38.2", features = ["sync", "io-util"] }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
actix-http = "3"
|
actix-http = "3"
|
||||||
@ -66,10 +66,10 @@ actix-web = "4"
|
|||||||
assert_matches = "1"
|
assert_matches = "1"
|
||||||
awc = "3"
|
awc = "3"
|
||||||
env_logger = "0.11"
|
env_logger = "0.11"
|
||||||
futures-util = { version = "0.3.17", default-features = false, features = ["alloc"] }
|
|
||||||
futures-test = "0.3"
|
futures-test = "0.3"
|
||||||
|
futures-util = { version = "0.3.17", default-features = false, features = ["alloc"] }
|
||||||
multer = "3"
|
multer = "3"
|
||||||
tokio = { version = "1.24.2", features = ["sync"] }
|
tokio = { version = "1.38.2", features = ["sync"] }
|
||||||
tokio-stream = "0.1"
|
tokio-stream = "0.1"
|
||||||
|
|
||||||
[lints]
|
[lints]
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
name = "actix-router"
|
name = "actix-router"
|
||||||
version = "0.5.3"
|
version = "0.5.3"
|
||||||
authors = [
|
authors = [
|
||||||
"Nikolay Kim <fafhrd91@gmail.com>",
|
"Nikolay Kim <fafhrd91@gmail.com>",
|
||||||
"Ali MJ Al-Nasrawy <alimjalnasrawy@gmail.com>",
|
"Ali MJ Al-Nasrawy <alimjalnasrawy@gmail.com>",
|
||||||
"Rob Ede <robjtede@icloud.com>",
|
"Rob Ede <robjtede@icloud.com>",
|
||||||
]
|
]
|
||||||
description = "Resource path matching and router"
|
description = "Resource path matching and router"
|
||||||
keywords = ["actix", "router", "routing"]
|
keywords = ["actix", "router", "routing"]
|
||||||
@ -13,10 +13,7 @@ license = "MIT OR Apache-2.0"
|
|||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[package.metadata.cargo_check_external_types]
|
[package.metadata.cargo_check_external_types]
|
||||||
allowed_external_types = [
|
allowed_external_types = ["http::*", "serde::*"]
|
||||||
"http::*",
|
|
||||||
"serde::*",
|
|
||||||
]
|
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["http", "unicode"]
|
default = ["http", "unicode"]
|
||||||
@ -35,8 +32,8 @@ tracing = { version = "0.1.30", default-features = false, features = ["log"] }
|
|||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
criterion = { version = "0.5", features = ["html_reports"] }
|
criterion = { version = "0.5", features = ["html_reports"] }
|
||||||
http = "0.2.7"
|
http = "0.2.7"
|
||||||
serde = { version = "1", features = ["derive"] }
|
|
||||||
percent-encoding = "2.1"
|
percent-encoding = "2.1"
|
||||||
|
serde = { version = "1", features = ["derive"] }
|
||||||
|
|
||||||
[lints]
|
[lints]
|
||||||
workspace = true
|
workspace = true
|
||||||
|
@ -1,37 +1,34 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "actix-test"
|
name = "actix-test"
|
||||||
version = "0.1.5"
|
version = "0.1.5"
|
||||||
authors = [
|
authors = ["Nikolay Kim <fafhrd91@gmail.com>", "Rob Ede <robjtede@icloud.com>"]
|
||||||
"Nikolay Kim <fafhrd91@gmail.com>",
|
|
||||||
"Rob Ede <robjtede@icloud.com>",
|
|
||||||
]
|
|
||||||
description = "Integration testing tools for Actix Web applications"
|
description = "Integration testing tools for Actix Web applications"
|
||||||
keywords = ["http", "web", "framework", "async", "futures"]
|
keywords = ["http", "web", "framework", "async", "futures"]
|
||||||
homepage = "https://actix.rs"
|
homepage = "https://actix.rs"
|
||||||
repository = "https://github.com/actix/actix-web"
|
repository = "https://github.com/actix/actix-web"
|
||||||
categories = [
|
categories = [
|
||||||
"network-programming",
|
"network-programming",
|
||||||
"asynchronous",
|
"asynchronous",
|
||||||
"web-programming::http-server",
|
"web-programming::http-server",
|
||||||
"web-programming::websocket",
|
"web-programming::websocket",
|
||||||
]
|
]
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[package.metadata.cargo_check_external_types]
|
[package.metadata.cargo_check_external_types]
|
||||||
allowed_external_types = [
|
allowed_external_types = [
|
||||||
"actix_codec::*",
|
"actix_codec::*",
|
||||||
"actix_http_test::*",
|
"actix_http_test::*",
|
||||||
"actix_http::*",
|
"actix_http::*",
|
||||||
"actix_service::*",
|
"actix_service::*",
|
||||||
"actix_web::*",
|
"actix_web::*",
|
||||||
"awc::*",
|
"awc::*",
|
||||||
"bytes::*",
|
"bytes::*",
|
||||||
"futures_core::*",
|
"futures_core::*",
|
||||||
"http::*",
|
"http::*",
|
||||||
"openssl::*",
|
"openssl::*",
|
||||||
"rustls::*",
|
"rustls::*",
|
||||||
"tokio::*",
|
"tokio::*",
|
||||||
]
|
]
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
@ -72,7 +69,7 @@ tls-rustls-0_20 = { package = "rustls", version = "0.20", optional = true }
|
|||||||
tls-rustls-0_21 = { package = "rustls", version = "0.21", optional = true }
|
tls-rustls-0_21 = { package = "rustls", version = "0.21", optional = true }
|
||||||
tls-rustls-0_22 = { package = "rustls", version = "0.22", optional = true }
|
tls-rustls-0_22 = { package = "rustls", version = "0.22", optional = true }
|
||||||
tls-rustls-0_23 = { package = "rustls", version = "0.23", default-features = false, optional = true }
|
tls-rustls-0_23 = { package = "rustls", version = "0.23", default-features = false, optional = true }
|
||||||
tokio = { version = "1.24.2", features = ["sync"] }
|
tokio = { version = "1.38.2", features = ["sync"] }
|
||||||
|
|
||||||
[lints]
|
[lints]
|
||||||
workspace = true
|
workspace = true
|
||||||
|
@ -12,12 +12,12 @@ rust-version.workspace = true
|
|||||||
|
|
||||||
[package.metadata.cargo_check_external_types]
|
[package.metadata.cargo_check_external_types]
|
||||||
allowed_external_types = [
|
allowed_external_types = [
|
||||||
"actix::*",
|
"actix::*",
|
||||||
"actix_http::*",
|
"actix_http::*",
|
||||||
"actix_web::*",
|
"actix_web::*",
|
||||||
"bytes::*",
|
"bytes::*",
|
||||||
"bytestring::*",
|
"bytestring::*",
|
||||||
"futures_core::*",
|
"futures_core::*",
|
||||||
]
|
]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
@ -30,14 +30,14 @@ bytes = "1"
|
|||||||
bytestring = "1"
|
bytestring = "1"
|
||||||
futures-core = { version = "0.3.17", default-features = false }
|
futures-core = { version = "0.3.17", default-features = false }
|
||||||
pin-project-lite = "0.2"
|
pin-project-lite = "0.2"
|
||||||
tokio = { version = "1.24.2", features = ["sync"] }
|
tokio = { version = "1.38.2", features = ["sync"] }
|
||||||
tokio-util = { version = "0.7", features = ["codec"] }
|
tokio-util = { version = "0.7", features = ["codec"] }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
actix-rt = "2.2"
|
actix-rt = "2.2"
|
||||||
actix-test = "0.1"
|
actix-test = "0.1"
|
||||||
awc = { version = "3", default-features = false }
|
|
||||||
actix-web = { version = "4", features = ["macros"] }
|
actix-web = { version = "4", features = ["macros"] }
|
||||||
|
awc = { version = "3", default-features = false }
|
||||||
|
|
||||||
env_logger = "0.11"
|
env_logger = "0.11"
|
||||||
futures-util = { version = "0.3.17", default-features = false, features = ["std"] }
|
futures-util = { version = "0.3.17", default-features = false, features = ["std"] }
|
||||||
|
@ -776,10 +776,7 @@ where
|
|||||||
}
|
}
|
||||||
Poll::Pending => break,
|
Poll::Pending => break,
|
||||||
Poll::Ready(Some(Err(err))) => {
|
Poll::Ready(Some(Err(err))) => {
|
||||||
return Poll::Ready(Some(Err(ProtocolError::Io(io::Error::new(
|
return Poll::Ready(Some(Err(ProtocolError::Io(io::Error::other(err)))));
|
||||||
io::ErrorKind::Other,
|
|
||||||
format!("{err}"),
|
|
||||||
)))));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -795,11 +792,10 @@ where
|
|||||||
}
|
}
|
||||||
Some(frm) => {
|
Some(frm) => {
|
||||||
let msg = match frm {
|
let msg = match frm {
|
||||||
Frame::Text(data) => {
|
Frame::Text(data) => Message::Text(
|
||||||
Message::Text(ByteString::try_from(data).map_err(|err| {
|
ByteString::try_from(data)
|
||||||
ProtocolError::Io(io::Error::new(io::ErrorKind::Other, err))
|
.map_err(|err| ProtocolError::Io(io::Error::other(err)))?,
|
||||||
})?)
|
),
|
||||||
}
|
|
||||||
Frame::Binary(data) => Message::Binary(data),
|
Frame::Binary(data) => Message::Binary(data),
|
||||||
Frame::Ping(s) => Message::Ping(s),
|
Frame::Ping(s) => Message::Ping(s),
|
||||||
Frame::Pong(s) => Message::Pong(s),
|
Frame::Pong(s) => Message::Pong(s),
|
||||||
|
@ -2,10 +2,7 @@
|
|||||||
name = "actix-web-codegen"
|
name = "actix-web-codegen"
|
||||||
version = "4.3.0"
|
version = "4.3.0"
|
||||||
description = "Routing and runtime macros for Actix Web"
|
description = "Routing and runtime macros for Actix Web"
|
||||||
authors = [
|
authors = ["Nikolay Kim <fafhrd91@gmail.com>", "Rob Ede <robjtede@icloud.com>"]
|
||||||
"Nikolay Kim <fafhrd91@gmail.com>",
|
|
||||||
"Rob Ede <robjtede@icloud.com>",
|
|
||||||
]
|
|
||||||
homepage.workspace = true
|
homepage.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
@ -33,8 +30,8 @@ actix-utils = "3"
|
|||||||
actix-web = "4"
|
actix-web = "4"
|
||||||
|
|
||||||
futures-core = { version = "0.3.17", default-features = false, features = ["alloc"] }
|
futures-core = { version = "0.3.17", default-features = false, features = ["alloc"] }
|
||||||
|
rustversion-msrv = "0.100"
|
||||||
trybuild = "1"
|
trybuild = "1"
|
||||||
rustversion = "1"
|
|
||||||
|
|
||||||
[lints]
|
[lints]
|
||||||
workspace = true
|
workspace = true
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#[rustversion::stable(1.72)] // MSRV
|
#[rustversion_msrv::msrv]
|
||||||
#[test]
|
#[test]
|
||||||
fn compile_macros() {
|
fn compile_macros() {
|
||||||
let t = trybuild::TestCases::new();
|
let t = trybuild::TestCases::new();
|
||||||
|
@ -2,6 +2,21 @@
|
|||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
## 4.11.0
|
||||||
|
|
||||||
|
- Add `Logger::log_level()` method.
|
||||||
|
- Improve handling of non-UTF-8 header values in `Logger` middleware.
|
||||||
|
- Add `HttpServer::shutdown_signal()` method.
|
||||||
|
- Mark `HttpServer` as `#[must_use]`.
|
||||||
|
- Allow SVG images to be compressed by the `Compress` middleware.
|
||||||
|
- Ignore `Host` header in `Host` guard when connection protocol is HTTP/2.
|
||||||
|
- Re-export `mime` dependency.
|
||||||
|
- Update `brotli` dependency to `8`.
|
||||||
|
|
||||||
|
## 4.10.2
|
||||||
|
|
||||||
|
- No significant changes since `4.10.1`.
|
||||||
|
|
||||||
## 4.10.1
|
## 4.10.1
|
||||||
|
|
||||||
- No significant changes since `4.10.0`.
|
- No significant changes since `4.10.0`.
|
||||||
|
@ -1,17 +1,14 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "actix-web"
|
name = "actix-web"
|
||||||
version = "4.10.1"
|
version = "4.11.0"
|
||||||
description = "Actix Web is a powerful, pragmatic, and extremely fast web framework for Rust"
|
description = "Actix Web is a powerful, pragmatic, and extremely fast web framework for Rust"
|
||||||
authors = [
|
authors = ["Nikolay Kim <fafhrd91@gmail.com>", "Rob Ede <robjtede@icloud.com>"]
|
||||||
"Nikolay Kim <fafhrd91@gmail.com>",
|
|
||||||
"Rob Ede <robjtede@icloud.com>",
|
|
||||||
]
|
|
||||||
keywords = ["actix", "http", "web", "framework", "async"]
|
keywords = ["actix", "http", "web", "framework", "async"]
|
||||||
categories = [
|
categories = [
|
||||||
"network-programming",
|
"network-programming",
|
||||||
"asynchronous",
|
"asynchronous",
|
||||||
"web-programming::http-server",
|
"web-programming::http-server",
|
||||||
"web-programming::websocket"
|
"web-programming::websocket",
|
||||||
]
|
]
|
||||||
homepage = "https://actix.rs"
|
homepage = "https://actix.rs"
|
||||||
repository = "https://github.com/actix/actix-web"
|
repository = "https://github.com/actix/actix-web"
|
||||||
@ -22,55 +19,55 @@ rust-version.workspace = true
|
|||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
rustdoc-args = ["--cfg", "docsrs"]
|
rustdoc-args = ["--cfg", "docsrs"]
|
||||||
features = [
|
features = [
|
||||||
"macros",
|
"macros",
|
||||||
"openssl",
|
"openssl",
|
||||||
"rustls-0_20",
|
"rustls-0_20",
|
||||||
"rustls-0_21",
|
"rustls-0_21",
|
||||||
"rustls-0_22",
|
"rustls-0_22",
|
||||||
"rustls-0_23",
|
"rustls-0_23",
|
||||||
"compress-brotli",
|
"compress-brotli",
|
||||||
"compress-gzip",
|
"compress-gzip",
|
||||||
"compress-zstd",
|
"compress-zstd",
|
||||||
"cookies",
|
"cookies",
|
||||||
"secure-cookies",
|
"secure-cookies",
|
||||||
]
|
]
|
||||||
|
|
||||||
[package.metadata.cargo_check_external_types]
|
[package.metadata.cargo_check_external_types]
|
||||||
allowed_external_types = [
|
allowed_external_types = [
|
||||||
"actix_http::*",
|
"actix_http::*",
|
||||||
"actix_router::*",
|
"actix_router::*",
|
||||||
"actix_rt::*",
|
"actix_rt::*",
|
||||||
"actix_server::*",
|
"actix_server::*",
|
||||||
"actix_service::*",
|
"actix_service::*",
|
||||||
"actix_utils::*",
|
"actix_utils::*",
|
||||||
"actix_web_codegen::*",
|
"actix_web_codegen::*",
|
||||||
"bytes::*",
|
"bytes::*",
|
||||||
"cookie::*",
|
"cookie::*",
|
||||||
"cookie",
|
"cookie",
|
||||||
"futures_core::*",
|
"futures_core::*",
|
||||||
"http::*",
|
"http::*",
|
||||||
"language_tags::*",
|
"language_tags::*",
|
||||||
"mime::*",
|
"mime::*",
|
||||||
"openssl::*",
|
"openssl::*",
|
||||||
"rustls::*",
|
"rustls::*",
|
||||||
"serde_json::*",
|
"serde_json::*",
|
||||||
"serde_urlencoded::*",
|
"serde_urlencoded::*",
|
||||||
"serde::*",
|
"serde::*",
|
||||||
"serde::*",
|
"serde::*",
|
||||||
"tokio::*",
|
"tokio::*",
|
||||||
"url::*",
|
"url::*",
|
||||||
]
|
]
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = [
|
default = [
|
||||||
"macros",
|
"macros",
|
||||||
"compress-brotli",
|
"compress-brotli",
|
||||||
"compress-gzip",
|
"compress-gzip",
|
||||||
"compress-zstd",
|
"compress-zstd",
|
||||||
"cookies",
|
"cookies",
|
||||||
"http2",
|
"http2",
|
||||||
"unicode",
|
"unicode",
|
||||||
"compat",
|
"compat",
|
||||||
]
|
]
|
||||||
|
|
||||||
# Brotli algorithm content-encoding support
|
# Brotli algorithm content-encoding support
|
||||||
@ -121,9 +118,7 @@ __tls = []
|
|||||||
experimental-io-uring = ["actix-server/io-uring"]
|
experimental-io-uring = ["actix-server/io-uring"]
|
||||||
|
|
||||||
# Feature group which, when disabled, helps migrate code to v5.0.
|
# Feature group which, when disabled, helps migrate code to v5.0.
|
||||||
compat = [
|
compat = ["compat-routing-macros-force-pub"]
|
||||||
"compat-routing-macros-force-pub",
|
|
||||||
]
|
|
||||||
|
|
||||||
# Opt-out forwards-compatibility for handler visibility inheritance fix.
|
# Opt-out forwards-compatibility for handler visibility inheritance fix.
|
||||||
compat-routing-macros-force-pub = ["actix-web-codegen?/compat-routing-macros-force-pub"]
|
compat-routing-macros-force-pub = ["actix-web-codegen?/compat-routing-macros-force-pub"]
|
||||||
@ -132,12 +127,12 @@ compat-routing-macros-force-pub = ["actix-web-codegen?/compat-routing-macros-for
|
|||||||
actix-codec = "0.5"
|
actix-codec = "0.5"
|
||||||
actix-macros = { version = "0.2.3", optional = true }
|
actix-macros = { version = "0.2.3", optional = true }
|
||||||
actix-rt = { version = "2.6", default-features = false }
|
actix-rt = { version = "2.6", default-features = false }
|
||||||
actix-server = "2"
|
actix-server = "2.6"
|
||||||
actix-service = "2"
|
actix-service = "2"
|
||||||
actix-utils = "3"
|
|
||||||
actix-tls = { version = "3.4", default-features = false, optional = true }
|
actix-tls = { version = "3.4", default-features = false, optional = true }
|
||||||
|
actix-utils = "3"
|
||||||
|
|
||||||
actix-http = { version = "3.7", features = ["ws"] }
|
actix-http = { version = "3.11", features = ["ws"] }
|
||||||
actix-router = { version = "0.5.3", default-features = false, features = ["http"] }
|
actix-router = { version = "0.5.3", default-features = false, features = ["http"] }
|
||||||
actix-web-codegen = { version = "4.3", optional = true, default-features = false }
|
actix-web-codegen = { version = "4.3", optional = true, default-features = false }
|
||||||
|
|
||||||
@ -150,12 +145,12 @@ encoding_rs = "0.8"
|
|||||||
foldhash = "0.1"
|
foldhash = "0.1"
|
||||||
futures-core = { version = "0.3.17", default-features = false }
|
futures-core = { version = "0.3.17", default-features = false }
|
||||||
futures-util = { version = "0.3.17", default-features = false }
|
futures-util = { version = "0.3.17", default-features = false }
|
||||||
itoa = "1"
|
|
||||||
impl-more = "0.1.4"
|
impl-more = "0.1.4"
|
||||||
|
itoa = "1"
|
||||||
language-tags = "0.3"
|
language-tags = "0.3"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
mime = "0.3"
|
mime = "0.3"
|
||||||
once_cell = "1.5"
|
once_cell = "1.21"
|
||||||
pin-project-lite = "0.2.7"
|
pin-project-lite = "0.2.7"
|
||||||
regex = { version = "1.5.5", optional = true }
|
regex = { version = "1.5.5", optional = true }
|
||||||
regex-lite = "0.1"
|
regex-lite = "0.1"
|
||||||
@ -163,18 +158,18 @@ serde = "1.0"
|
|||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
serde_urlencoded = "0.7"
|
serde_urlencoded = "0.7"
|
||||||
smallvec = "1.6.1"
|
smallvec = "1.6.1"
|
||||||
tracing = "0.1.30"
|
|
||||||
socket2 = "0.5"
|
socket2 = "0.5"
|
||||||
time = { version = "0.3", default-features = false, features = ["formatting"] }
|
time = { version = "0.3", default-features = false, features = ["formatting"] }
|
||||||
url = "2.1"
|
tracing = "0.1.30"
|
||||||
|
url = "2.5.4"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
actix-files = "0.6"
|
actix-files = "0.6"
|
||||||
actix-test = { version = "0.1", features = ["openssl", "rustls-0_23"] }
|
actix-test = { version = "0.1", features = ["openssl", "rustls-0_23"] }
|
||||||
awc = { version = "3", features = ["openssl"] }
|
awc = { version = "3", features = ["openssl"] }
|
||||||
|
|
||||||
brotli = "7"
|
brotli = "8"
|
||||||
const-str = "0.5"
|
const-str = "0.5" # TODO(MSRV 1.77): update to 0.6
|
||||||
core_affinity = "0.8"
|
core_affinity = "0.8"
|
||||||
criterion = { version = "0.5", features = ["html_reports"] }
|
criterion = { version = "0.5", features = ["html_reports"] }
|
||||||
env_logger = "0.11"
|
env_logger = "0.11"
|
||||||
@ -187,7 +182,8 @@ serde = { version = "1", features = ["derive"] }
|
|||||||
static_assertions = "1"
|
static_assertions = "1"
|
||||||
tls-openssl = { package = "openssl", version = "0.10.55" }
|
tls-openssl = { package = "openssl", version = "0.10.55" }
|
||||||
tls-rustls = { package = "rustls", version = "0.23" }
|
tls-rustls = { package = "rustls", version = "0.23" }
|
||||||
tokio = { version = "1.24.2", features = ["rt-multi-thread", "macros"] }
|
tokio = { version = "1.38.2", features = ["rt-multi-thread", "macros"] }
|
||||||
|
tokio-util = "0.7"
|
||||||
zstd = "0.13"
|
zstd = "0.13"
|
||||||
|
|
||||||
[lints]
|
[lints]
|
||||||
|
@ -8,10 +8,10 @@
|
|||||||
<!-- prettier-ignore-start -->
|
<!-- prettier-ignore-start -->
|
||||||
|
|
||||||
[](https://crates.io/crates/actix-web)
|
[](https://crates.io/crates/actix-web)
|
||||||
[](https://docs.rs/actix-web/4.10.1)
|
[](https://docs.rs/actix-web/4.11.0)
|
||||||

|

|
||||||

|

|
||||||
[](https://deps.rs/crate/actix-web/4.10.1)
|
[](https://deps.rs/crate/actix-web/4.11.0)
|
||||||
<br />
|
<br />
|
||||||
[](https://github.com/actix/actix-web/actions/workflows/ci.yml)
|
[](https://github.com/actix/actix-web/actions/workflows/ci.yml)
|
||||||
[](https://codecov.io/gh/actix/actix-web)
|
[](https://codecov.io/gh/actix/actix-web)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use actix_http::{header, uri::Uri, RequestHead};
|
use actix_http::{header, uri::Uri, RequestHead, Version};
|
||||||
|
|
||||||
use super::{Guard, GuardContext};
|
use super::{Guard, GuardContext};
|
||||||
|
|
||||||
@ -66,6 +66,7 @@ fn get_host_uri(req: &RequestHead) -> Option<Uri> {
|
|||||||
req.headers
|
req.headers
|
||||||
.get(header::HOST)
|
.get(header::HOST)
|
||||||
.and_then(|host_value| host_value.to_str().ok())
|
.and_then(|host_value| host_value.to_str().ok())
|
||||||
|
.filter(|_| req.version < Version::HTTP_2)
|
||||||
.or_else(|| req.uri.host())
|
.or_else(|| req.uri.host())
|
||||||
.and_then(|host| host.parse().ok())
|
.and_then(|host| host.parse().ok())
|
||||||
}
|
}
|
||||||
@ -123,6 +124,38 @@ mod tests {
|
|||||||
use super::*;
|
use super::*;
|
||||||
use crate::test::TestRequest;
|
use crate::test::TestRequest;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn host_not_from_header_if_http2() {
|
||||||
|
let req = TestRequest::default()
|
||||||
|
.uri("www.rust-lang.org")
|
||||||
|
.insert_header((
|
||||||
|
header::HOST,
|
||||||
|
header::HeaderValue::from_static("www.example.com"),
|
||||||
|
))
|
||||||
|
.to_srv_request();
|
||||||
|
|
||||||
|
let host = Host("www.example.com");
|
||||||
|
assert!(host.check(&req.guard_ctx()));
|
||||||
|
|
||||||
|
let host = Host("www.rust-lang.org");
|
||||||
|
assert!(!host.check(&req.guard_ctx()));
|
||||||
|
|
||||||
|
let req = TestRequest::default()
|
||||||
|
.version(actix_http::Version::HTTP_2)
|
||||||
|
.uri("www.rust-lang.org")
|
||||||
|
.insert_header((
|
||||||
|
header::HOST,
|
||||||
|
header::HeaderValue::from_static("www.example.com"),
|
||||||
|
))
|
||||||
|
.to_srv_request();
|
||||||
|
|
||||||
|
let host = Host("www.example.com");
|
||||||
|
assert!(!host.check(&req.guard_ctx()));
|
||||||
|
|
||||||
|
let host = Host("www.rust-lang.org");
|
||||||
|
assert!(host.check(&req.guard_ctx()));
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn host_from_header() {
|
fn host_from_header() {
|
||||||
let req = TestRequest::default()
|
let req = TestRequest::default()
|
||||||
|
@ -70,7 +70,7 @@ use crate::{
|
|||||||
/// This is the source code for the 2-parameter implementation of `Handler` to help illustrate the
|
/// This is the source code for the 2-parameter implementation of `Handler` to help illustrate the
|
||||||
/// bounds of the handler call after argument extraction:
|
/// bounds of the handler call after argument extraction:
|
||||||
/// ```ignore
|
/// ```ignore
|
||||||
/// impl<Func, Arg1, Arg2, Fut> Handler<(Arg1, Arg2)> for Func
|
/// impl<Func, Fut, Arg1, Arg2> Handler<(Arg1, Arg2)> for Func
|
||||||
/// where
|
/// where
|
||||||
/// Func: Fn(Arg1, Arg2) -> Fut + Clone + 'static,
|
/// Func: Fn(Arg1, Arg2) -> Fut + Clone + 'static,
|
||||||
/// Fut: Future,
|
/// Fut: Future,
|
||||||
|
@ -158,7 +158,7 @@ impl ConnectionInfo {
|
|||||||
/// The address is resolved through the following, in order:
|
/// The address is resolved through the following, in order:
|
||||||
/// - `Forwarded` header
|
/// - `Forwarded` header
|
||||||
/// - `X-Forwarded-For` header
|
/// - `X-Forwarded-For` header
|
||||||
/// - peer address of opened socket (same as [`remote_addr`](Self::remote_addr))
|
/// - peer address of opened socket (same as [`peer_addr`](Self::peer_addr))
|
||||||
///
|
///
|
||||||
/// # Security
|
/// # Security
|
||||||
/// Do not use this function for security purposes unless you can be sure that the `Forwarded`
|
/// Do not use this function for security purposes unless you can be sure that the `Forwarded`
|
||||||
|
@ -78,7 +78,7 @@ pub use actix_http::{body, HttpMessage};
|
|||||||
#[cfg(feature = "cookies")]
|
#[cfg(feature = "cookies")]
|
||||||
#[doc(inline)]
|
#[doc(inline)]
|
||||||
pub use cookie;
|
pub use cookie;
|
||||||
|
pub use mime;
|
||||||
mod app;
|
mod app;
|
||||||
mod app_service;
|
mod app_service;
|
||||||
mod config;
|
mod config;
|
||||||
|
@ -191,8 +191,10 @@ where
|
|||||||
None => true,
|
None => true,
|
||||||
Some(hdr) => {
|
Some(hdr) => {
|
||||||
match hdr.to_str().ok().and_then(|hdr| hdr.parse::<Mime>().ok()) {
|
match hdr.to_str().ok().and_then(|hdr| hdr.parse::<Mime>().ok()) {
|
||||||
Some(mime) if mime.type_().as_str() == "image" => false,
|
Some(mime) if mime.type_() == mime::IMAGE => {
|
||||||
Some(mime) if mime.type_().as_str() == "video" => false,
|
matches!(mime.subtype(), mime::SVG)
|
||||||
|
}
|
||||||
|
Some(mime) if mime.type_() == mime::VIDEO => false,
|
||||||
_ => true,
|
_ => true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ use actix_service::{Service, Transform};
|
|||||||
use actix_utils::future::{ready, Ready};
|
use actix_utils::future::{ready, Ready};
|
||||||
use bytes::Bytes;
|
use bytes::Bytes;
|
||||||
use futures_core::ready;
|
use futures_core::ready;
|
||||||
use log::{debug, warn};
|
use log::{debug, warn, Level};
|
||||||
use pin_project_lite::pin_project;
|
use pin_project_lite::pin_project;
|
||||||
#[cfg(feature = "unicode")]
|
#[cfg(feature = "unicode")]
|
||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
@ -92,6 +92,7 @@ struct Inner {
|
|||||||
exclude: HashSet<String>,
|
exclude: HashSet<String>,
|
||||||
exclude_regex: Vec<Regex>,
|
exclude_regex: Vec<Regex>,
|
||||||
log_target: Cow<'static, str>,
|
log_target: Cow<'static, str>,
|
||||||
|
log_level: Level,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Logger {
|
impl Logger {
|
||||||
@ -102,6 +103,7 @@ impl Logger {
|
|||||||
exclude: HashSet::new(),
|
exclude: HashSet::new(),
|
||||||
exclude_regex: Vec::new(),
|
exclude_regex: Vec::new(),
|
||||||
log_target: Cow::Borrowed(module_path!()),
|
log_target: Cow::Borrowed(module_path!()),
|
||||||
|
log_level: Level::Info,
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -139,6 +141,23 @@ impl Logger {
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Sets the log level to `level`.
|
||||||
|
///
|
||||||
|
/// By default, the log level is `Level::Info`.
|
||||||
|
///
|
||||||
|
/// # Examples
|
||||||
|
/// Using `.log_level(Level::Debug)` would have this effect on request logs:
|
||||||
|
/// ```diff
|
||||||
|
/// - [2015-10-21T07:28:00Z INFO actix_web::middleware::logger] 127.0.0.1 "GET / HTTP/1.1" 200 88 "-" "dmc/1.0" 0.001985
|
||||||
|
/// + [2015-10-21T07:28:00Z DEBUG actix_web::middleware::logger] 127.0.0.1 "GET / HTTP/1.1" 200 88 "-" "dmc/1.0" 0.001985
|
||||||
|
/// ^^^^^^
|
||||||
|
/// ```
|
||||||
|
pub fn log_level(mut self, level: log::Level) -> Self {
|
||||||
|
let inner = Rc::get_mut(&mut self.0).unwrap();
|
||||||
|
inner.log_level = level;
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
/// Register a function that receives a ServiceRequest and returns a String for use in the
|
/// Register a function that receives a ServiceRequest and returns a String for use in the
|
||||||
/// log line. The label passed as the first argument should match a replacement substring in
|
/// log line. The label passed as the first argument should match a replacement substring in
|
||||||
/// the logger format like `%{label}xi`.
|
/// the logger format like `%{label}xi`.
|
||||||
@ -242,6 +261,7 @@ impl Default for Logger {
|
|||||||
exclude: HashSet::new(),
|
exclude: HashSet::new(),
|
||||||
exclude_regex: Vec::new(),
|
exclude_regex: Vec::new(),
|
||||||
log_target: Cow::Borrowed(module_path!()),
|
log_target: Cow::Borrowed(module_path!()),
|
||||||
|
log_level: Level::Info,
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -312,6 +332,7 @@ where
|
|||||||
format: None,
|
format: None,
|
||||||
time: OffsetDateTime::now_utc(),
|
time: OffsetDateTime::now_utc(),
|
||||||
log_target: Cow::Borrowed(""),
|
log_target: Cow::Borrowed(""),
|
||||||
|
log_level: self.inner.log_level,
|
||||||
_phantom: PhantomData,
|
_phantom: PhantomData,
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -327,6 +348,7 @@ where
|
|||||||
format: Some(format),
|
format: Some(format),
|
||||||
time: now,
|
time: now,
|
||||||
log_target: self.inner.log_target.clone(),
|
log_target: self.inner.log_target.clone(),
|
||||||
|
log_level: self.inner.log_level,
|
||||||
_phantom: PhantomData,
|
_phantom: PhantomData,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -344,6 +366,7 @@ pin_project! {
|
|||||||
time: OffsetDateTime,
|
time: OffsetDateTime,
|
||||||
format: Option<Format>,
|
format: Option<Format>,
|
||||||
log_target: Cow<'static, str>,
|
log_target: Cow<'static, str>,
|
||||||
|
log_level: Level,
|
||||||
_phantom: PhantomData<B>,
|
_phantom: PhantomData<B>,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -390,6 +413,7 @@ where
|
|||||||
let time = *this.time;
|
let time = *this.time;
|
||||||
let format = this.format.take();
|
let format = this.format.take();
|
||||||
let log_target = this.log_target.clone();
|
let log_target = this.log_target.clone();
|
||||||
|
let log_level = *this.log_level;
|
||||||
|
|
||||||
Poll::Ready(Ok(res.map_body(move |_, body| StreamLog {
|
Poll::Ready(Ok(res.map_body(move |_, body| StreamLog {
|
||||||
body,
|
body,
|
||||||
@ -397,6 +421,7 @@ where
|
|||||||
format,
|
format,
|
||||||
size: 0,
|
size: 0,
|
||||||
log_target,
|
log_target,
|
||||||
|
log_level,
|
||||||
})))
|
})))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -409,6 +434,7 @@ pin_project! {
|
|||||||
size: usize,
|
size: usize,
|
||||||
time: OffsetDateTime,
|
time: OffsetDateTime,
|
||||||
log_target: Cow<'static, str>,
|
log_target: Cow<'static, str>,
|
||||||
|
log_level: Level
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<B> PinnedDrop for StreamLog<B> {
|
impl<B> PinnedDrop for StreamLog<B> {
|
||||||
@ -421,8 +447,9 @@ pin_project! {
|
|||||||
Ok(())
|
Ok(())
|
||||||
};
|
};
|
||||||
|
|
||||||
log::info!(
|
log::log!(
|
||||||
target: this.log_target.as_ref(),
|
target: this.log_target.as_ref(),
|
||||||
|
this.log_level,
|
||||||
"{}", FormatDisplay(&render)
|
"{}", FormatDisplay(&render)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -622,9 +649,9 @@ impl FormatText {
|
|||||||
|
|
||||||
FormatText::ResponseHeader(ref name) => {
|
FormatText::ResponseHeader(ref name) => {
|
||||||
let s = if let Some(val) = res.headers().get(name) {
|
let s = if let Some(val) = res.headers().get(name) {
|
||||||
val.to_str().unwrap_or("-")
|
String::from_utf8_lossy(val.as_bytes()).into_owned()
|
||||||
} else {
|
} else {
|
||||||
"-"
|
"-".to_owned()
|
||||||
};
|
};
|
||||||
*self = FormatText::Str(s.to_string())
|
*self = FormatText::Str(s.to_string())
|
||||||
}
|
}
|
||||||
@ -666,11 +693,11 @@ impl FormatText {
|
|||||||
FormatText::RequestTime => *self = FormatText::Str(now.format(&Rfc3339).unwrap()),
|
FormatText::RequestTime => *self = FormatText::Str(now.format(&Rfc3339).unwrap()),
|
||||||
FormatText::RequestHeader(ref name) => {
|
FormatText::RequestHeader(ref name) => {
|
||||||
let s = if let Some(val) = req.headers().get(name) {
|
let s = if let Some(val) = req.headers().get(name) {
|
||||||
val.to_str().unwrap_or("-")
|
String::from_utf8_lossy(val.as_bytes()).into_owned()
|
||||||
} else {
|
} else {
|
||||||
"-"
|
"-".to_owned()
|
||||||
};
|
};
|
||||||
*self = FormatText::Str(s.to_string());
|
*self = FormatText::Str(s);
|
||||||
}
|
}
|
||||||
FormatText::RemoteAddr => {
|
FormatText::RemoteAddr => {
|
||||||
let s = if let Some(peer) = req.connection_info().peer_addr() {
|
let s = if let Some(peer) = req.connection_info().peer_addr() {
|
||||||
|
@ -264,8 +264,10 @@ impl HttpRequest {
|
|||||||
///
|
///
|
||||||
/// For expanded client connection information, use [`connection_info`] instead.
|
/// For expanded client connection information, use [`connection_info`] instead.
|
||||||
///
|
///
|
||||||
/// Will only return None when called in unit tests unless [`TestRequest::peer_addr`] is used.
|
/// Will only return `None` when server is listening on [UDS socket] or when called in unit
|
||||||
|
/// tests unless [`TestRequest::peer_addr`] is used.
|
||||||
///
|
///
|
||||||
|
/// [UDS socket]: crate::HttpServer::bind_uds
|
||||||
/// [`TestRequest::peer_addr`]: crate::test::TestRequest::peer_addr
|
/// [`TestRequest::peer_addr`]: crate::test::TestRequest::peer_addr
|
||||||
/// [`connection_info`]: Self::connection_info
|
/// [`connection_info`]: Self::connection_info
|
||||||
#[inline]
|
#[inline]
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
use std::{
|
use std::{
|
||||||
any::Any,
|
any::Any,
|
||||||
cmp, fmt, io,
|
cmp, fmt,
|
||||||
|
future::Future,
|
||||||
|
io,
|
||||||
marker::PhantomData,
|
marker::PhantomData,
|
||||||
net,
|
net,
|
||||||
sync::{Arc, Mutex},
|
sync::{Arc, Mutex},
|
||||||
@ -64,6 +66,7 @@ struct Config {
|
|||||||
/// .await
|
/// .await
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
#[must_use]
|
||||||
pub struct HttpServer<F, I, S, B>
|
pub struct HttpServer<F, I, S, B>
|
||||||
where
|
where
|
||||||
F: Fn() -> I + Send + Clone + 'static,
|
F: Fn() -> I + Send + Clone + 'static,
|
||||||
@ -272,19 +275,12 @@ where
|
|||||||
/// - `actix_web::rt::net::TcpStream` when no encryption is used.
|
/// - `actix_web::rt::net::TcpStream` when no encryption is used.
|
||||||
///
|
///
|
||||||
/// See the `on_connect` example for additional details.
|
/// See the `on_connect` example for additional details.
|
||||||
pub fn on_connect<CB>(self, f: CB) -> HttpServer<F, I, S, B>
|
pub fn on_connect<CB>(mut self, f: CB) -> HttpServer<F, I, S, B>
|
||||||
where
|
where
|
||||||
CB: Fn(&dyn Any, &mut Extensions) + Send + Sync + 'static,
|
CB: Fn(&dyn Any, &mut Extensions) + Send + Sync + 'static,
|
||||||
{
|
{
|
||||||
HttpServer {
|
self.on_connect_fn = Some(Arc::new(f));
|
||||||
factory: self.factory,
|
self
|
||||||
config: self.config,
|
|
||||||
backlog: self.backlog,
|
|
||||||
sockets: self.sockets,
|
|
||||||
builder: self.builder,
|
|
||||||
on_connect_fn: Some(Arc::new(f)),
|
|
||||||
_phantom: PhantomData,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Sets server host name.
|
/// Sets server host name.
|
||||||
@ -312,6 +308,37 @@ where
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Specify shutdown signal from a future.
|
||||||
|
///
|
||||||
|
/// Using this method will prevent OS signal handlers being set up.
|
||||||
|
///
|
||||||
|
/// Typically, a `CancellationToken` will be used, but any future _can_ be.
|
||||||
|
///
|
||||||
|
/// # Examples
|
||||||
|
///
|
||||||
|
/// ```no_run
|
||||||
|
/// use actix_web::{App, HttpServer};
|
||||||
|
/// use tokio_util::sync::CancellationToken;
|
||||||
|
///
|
||||||
|
/// # #[actix_web::main]
|
||||||
|
/// # async fn main() -> std::io::Result<()> {
|
||||||
|
/// let stop_signal = CancellationToken::new();
|
||||||
|
///
|
||||||
|
/// HttpServer::new(move || App::new())
|
||||||
|
/// .shutdown_signal(stop_signal.cancelled_owned())
|
||||||
|
/// .bind(("127.0.0.1", 8080))?
|
||||||
|
/// .run()
|
||||||
|
/// .await
|
||||||
|
/// # }
|
||||||
|
/// ```
|
||||||
|
pub fn shutdown_signal<Fut>(mut self, shutdown_signal: Fut) -> Self
|
||||||
|
where
|
||||||
|
Fut: Future<Output = ()> + Send + 'static,
|
||||||
|
{
|
||||||
|
self.builder = self.builder.shutdown_signal(shutdown_signal);
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
/// Sets timeout for graceful worker shutdown of workers.
|
/// Sets timeout for graceful worker shutdown of workers.
|
||||||
///
|
///
|
||||||
/// After receiving a stop signal, workers have this much time to finish serving requests.
|
/// After receiving a stop signal, workers have this much time to finish serving requests.
|
||||||
@ -882,6 +909,7 @@ where
|
|||||||
let factory = self.factory.clone();
|
let factory = self.factory.clone();
|
||||||
let cfg = Arc::clone(&self.config);
|
let cfg = Arc::clone(&self.config);
|
||||||
let addr = lst.local_addr().unwrap();
|
let addr = lst.local_addr().unwrap();
|
||||||
|
|
||||||
self.sockets.push(Socket {
|
self.sockets.push(Socket {
|
||||||
addr,
|
addr,
|
||||||
scheme: "https",
|
scheme: "https",
|
||||||
@ -986,6 +1014,7 @@ where
|
|||||||
let factory = self.factory.clone();
|
let factory = self.factory.clone();
|
||||||
let socket_addr =
|
let socket_addr =
|
||||||
net::SocketAddr::new(net::IpAddr::V4(net::Ipv4Addr::new(127, 0, 0, 1)), 8080);
|
net::SocketAddr::new(net::IpAddr::V4(net::Ipv4Addr::new(127, 0, 0, 1)), 8080);
|
||||||
|
|
||||||
self.sockets.push(Socket {
|
self.sockets.push(Socket {
|
||||||
scheme: "http",
|
scheme: "http",
|
||||||
addr: socket_addr,
|
addr: socket_addr,
|
||||||
@ -1073,10 +1102,7 @@ fn bind_addrs(addrs: impl net::ToSocketAddrs, backlog: u32) -> io::Result<Vec<ne
|
|||||||
} else if let Some(err) = err.take() {
|
} else if let Some(err) = err.take() {
|
||||||
Err(err)
|
Err(err)
|
||||||
} else {
|
} else {
|
||||||
Err(io::Error::new(
|
Err(io::Error::other("Could not bind to address"))
|
||||||
io::ErrorKind::Other,
|
|
||||||
"Can not bind to address.",
|
|
||||||
))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
## 3.7.0
|
||||||
|
|
||||||
|
- Update `brotli` dependency to `8`.
|
||||||
|
|
||||||
## 3.6.0
|
## 3.6.0
|
||||||
|
|
||||||
- Prevent panics on connection pool drop when Tokio runtime is shutdown early.
|
- Prevent panics on connection pool drop when Tokio runtime is shutdown early.
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "awc"
|
name = "awc"
|
||||||
version = "3.6.0"
|
version = "3.7.0"
|
||||||
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
||||||
description = "Async HTTP and WebSocket client library"
|
description = "Async HTTP and WebSocket client library"
|
||||||
keywords = ["actix", "http", "framework", "async", "web"]
|
keywords = ["actix", "http", "framework", "async", "web"]
|
||||||
@ -97,9 +97,9 @@ dangerous-h2c = []
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
actix-codec = "0.5"
|
actix-codec = "0.5"
|
||||||
actix-service = "2"
|
|
||||||
actix-http = { version = "3.10", features = ["http2", "ws"] }
|
actix-http = { version = "3.10", features = ["http2", "ws"] }
|
||||||
actix-rt = { version = "2.1", default-features = false }
|
actix-rt = { version = "2.1", default-features = false }
|
||||||
|
actix-service = "2"
|
||||||
actix-tls = { version = "3.4", features = ["connect", "uri"] }
|
actix-tls = { version = "3.4", features = ["connect", "uri"] }
|
||||||
actix-utils = "3"
|
actix-utils = "3"
|
||||||
|
|
||||||
@ -112,7 +112,7 @@ futures-util = { version = "0.3.17", default-features = false, features = ["allo
|
|||||||
h2 = "0.3.26"
|
h2 = "0.3.26"
|
||||||
http = "0.2.7"
|
http = "0.2.7"
|
||||||
itoa = "1"
|
itoa = "1"
|
||||||
log =" 0.4"
|
log = "0.4"
|
||||||
mime = "0.3"
|
mime = "0.3"
|
||||||
percent-encoding = "2.1"
|
percent-encoding = "2.1"
|
||||||
pin-project-lite = "0.2"
|
pin-project-lite = "0.2"
|
||||||
@ -120,7 +120,7 @@ rand = "0.9"
|
|||||||
serde = "1.0"
|
serde = "1.0"
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
serde_urlencoded = "0.7"
|
serde_urlencoded = "0.7"
|
||||||
tokio = { version = "1.24.2", features = ["sync"] }
|
tokio = { version = "1.38.2", features = ["sync"] }
|
||||||
|
|
||||||
cookie = { version = "0.16", features = ["percent-encode"], optional = true }
|
cookie = { version = "0.16", features = ["percent-encode"], optional = true }
|
||||||
|
|
||||||
@ -141,15 +141,15 @@ actix-tls = { version = "3.4", features = ["openssl", "rustls-0_23"] }
|
|||||||
actix-utils = "3"
|
actix-utils = "3"
|
||||||
actix-web = { version = "4", features = ["openssl"] }
|
actix-web = { version = "4", features = ["openssl"] }
|
||||||
|
|
||||||
brotli = "7"
|
brotli = "8"
|
||||||
const-str = "0.5"
|
const-str = "0.5" # TODO(MSRV 1.77): update to 0.6
|
||||||
env_logger = "0.11"
|
env_logger = "0.11"
|
||||||
flate2 = "1.0.13"
|
flate2 = "1.0.13"
|
||||||
futures-util = { version = "0.3.17", default-features = false }
|
futures-util = { version = "0.3.17", default-features = false }
|
||||||
static_assertions = "1.1"
|
static_assertions = "1.1"
|
||||||
rcgen = "0.13"
|
rcgen = "0.13"
|
||||||
rustls-pemfile = "2"
|
rustls-pemfile = "2"
|
||||||
tokio = { version = "1.24.2", features = ["rt-multi-thread", "macros"] }
|
tokio = { version = "1.38.2", features = ["rt-multi-thread", "macros"] }
|
||||||
zstd = "0.13"
|
zstd = "0.13"
|
||||||
tls-rustls-0_23 = { package = "rustls", version = "0.23" } # add rustls 0.23 with default features to make aws_lc_rs work in tests
|
tls-rustls-0_23 = { package = "rustls", version = "0.23" } # add rustls 0.23 with default features to make aws_lc_rs work in tests
|
||||||
|
|
||||||
|
@ -5,9 +5,9 @@
|
|||||||
<!-- prettier-ignore-start -->
|
<!-- prettier-ignore-start -->
|
||||||
|
|
||||||
[](https://crates.io/crates/awc)
|
[](https://crates.io/crates/awc)
|
||||||
[](https://docs.rs/awc/3.6.0)
|
[](https://docs.rs/awc/3.7.0)
|
||||||

|

|
||||||
[](https://deps.rs/crate/awc/3.6.0)
|
[](https://deps.rs/crate/awc/3.7.0)
|
||||||
[](https://discord.gg/NWpN5mmg3x)
|
[](https://discord.gg/NWpN5mmg3x)
|
||||||
|
|
||||||
<!-- prettier-ignore-end -->
|
<!-- prettier-ignore-end -->
|
||||||
|
@ -179,9 +179,8 @@ where
|
|||||||
.acquire_owned()
|
.acquire_owned()
|
||||||
.await
|
.await
|
||||||
.map_err(|_| {
|
.map_err(|_| {
|
||||||
ConnectError::Io(io::Error::new(
|
ConnectError::Io(io::Error::other(
|
||||||
io::ErrorKind::Other,
|
"Failed to acquire semaphore on client connection pool",
|
||||||
"failed to acquire semaphore on client connection pool",
|
|
||||||
))
|
))
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
|
44
justfile
44
justfile
@ -1,20 +1,22 @@
|
|||||||
_list:
|
_list:
|
||||||
@just --list
|
@just --list
|
||||||
|
|
||||||
|
toolchain := ""
|
||||||
|
|
||||||
# Format workspace.
|
# Format workspace.
|
||||||
fmt:
|
fmt:
|
||||||
just --unstable --fmt
|
just --unstable --fmt
|
||||||
cargo +nightly fmt
|
cargo +nightly fmt
|
||||||
fd --hidden --type=file --extension=md --extension=yml --exec-batch npx -y prettier --write
|
fd --hidden --type=file --extension=md --extension=yml --exec-batch npx -y prettier --write
|
||||||
|
|
||||||
# Downgrade dev-dependencies necessary to run MSRV checks/tests.
|
# Downgrade dependencies necessary to run MSRV checks/tests.
|
||||||
[private]
|
[private]
|
||||||
downgrade-for-msrv:
|
downgrade-for-msrv:
|
||||||
cargo update -p=parse-size --precise=1.0.0
|
cargo {{ toolchain }} update -p=divan --precise=0.1.15 # next ver: 1.80.0
|
||||||
cargo update -p=clap --precise=4.4.18
|
cargo {{ toolchain }} update -p=half --precise=2.4.1 # next ver: 1.81.0
|
||||||
cargo update -p=divan --precise=0.1.15
|
cargo {{ toolchain }} update -p=idna_adapter --precise=1.2.0 # next ver: 1.82.0
|
||||||
cargo update -p=litemap --precise=0.7.4
|
cargo {{ toolchain }} update -p=litemap --precise=0.7.4 # next ver: 1.81.0
|
||||||
cargo update -p=zerofrom --precise=0.1.5
|
cargo {{ toolchain }} update -p=zerofrom --precise=0.1.5 # next ver: 1.81.0
|
||||||
|
|
||||||
msrv := ```
|
msrv := ```
|
||||||
cargo metadata --format-version=1 \
|
cargo metadata --format-version=1 \
|
||||||
@ -39,42 +41,50 @@ check-min:
|
|||||||
check-default:
|
check-default:
|
||||||
cargo hack --workspace check
|
cargo hack --workspace check
|
||||||
|
|
||||||
# Run Clippy over workspace.
|
# Check workspace.
|
||||||
check toolchain="": && (clippy toolchain)
|
check: && clippy
|
||||||
|
fd --hidden --type=file --extension=md --extension=yml --exec-batch npx -y prettier --check
|
||||||
|
|
||||||
# Run Clippy over workspace.
|
# Run Clippy over workspace.
|
||||||
clippy toolchain="":
|
clippy:
|
||||||
cargo {{ toolchain }} clippy --workspace --all-targets {{ all_crate_features }}
|
cargo {{ toolchain }} clippy --workspace --all-targets {{ all_crate_features }}
|
||||||
|
|
||||||
# Test workspace using MSRV.
|
# Run Clippy over workspace using MSRV.
|
||||||
test-msrv: downgrade-for-msrv (test msrv_rustup)
|
clippy-msrv:
|
||||||
|
@just toolchain={{ msrv_rustup }} downgrade-for-msrv
|
||||||
|
@just toolchain={{ msrv_rustup }} clippy
|
||||||
|
|
||||||
# Test workspace code.
|
# Test workspace code.
|
||||||
test toolchain="":
|
test:
|
||||||
cargo {{ toolchain }} test --lib --tests -p=actix-web-codegen --all-features
|
cargo {{ toolchain }} test --lib --tests -p=actix-web-codegen --all-features
|
||||||
cargo {{ toolchain }} test --lib --tests -p=actix-multipart-derive --all-features
|
cargo {{ toolchain }} test --lib --tests -p=actix-multipart-derive --all-features
|
||||||
cargo {{ toolchain }} nextest run --no-tests=warn -p=actix-router --no-default-features
|
cargo {{ toolchain }} nextest run --no-tests=warn -p=actix-router --no-default-features
|
||||||
cargo {{ toolchain }} nextest run --no-tests=warn --workspace --exclude=actix-web-codegen --exclude=actix-multipart-derive {{ all_crate_features }} --filter-expr="not test(test_reading_deflate_encoding_large_random_rustls)"
|
cargo {{ toolchain }} nextest run --no-tests=warn --workspace --exclude=actix-web-codegen --exclude=actix-multipart-derive {{ all_crate_features }} --filter-expr="not test(test_reading_deflate_encoding_large_random_rustls)"
|
||||||
|
|
||||||
|
# Test workspace using MSRV.
|
||||||
|
test-msrv:
|
||||||
|
@just toolchain={{ msrv_rustup }} downgrade-for-msrv
|
||||||
|
@just toolchain={{ msrv_rustup }} test
|
||||||
|
|
||||||
# Test workspace docs.
|
# Test workspace docs.
|
||||||
test-docs toolchain="": && doc
|
test-docs: && doc
|
||||||
cargo {{ toolchain }} test --doc --workspace {{ all_crate_features }} --no-fail-fast -- --nocapture
|
cargo {{ toolchain }} test --doc --workspace {{ all_crate_features }} --no-fail-fast -- --nocapture
|
||||||
|
|
||||||
# Test workspace.
|
# Test workspace.
|
||||||
test-all toolchain="": (test toolchain) (test-docs toolchain)
|
test-all: test test-docs
|
||||||
|
|
||||||
# Test workspace and collect coverage info.
|
# Test workspace and collect coverage info.
|
||||||
[private]
|
[private]
|
||||||
test-coverage toolchain="":
|
test-coverage:
|
||||||
cargo {{ toolchain }} llvm-cov nextest --no-tests=warn --no-report {{ all_crate_features }}
|
cargo {{ toolchain }} llvm-cov nextest --no-tests=warn --no-report {{ all_crate_features }}
|
||||||
cargo {{ toolchain }} llvm-cov --doc --no-report {{ all_crate_features }}
|
cargo {{ toolchain }} llvm-cov --doc --no-report {{ all_crate_features }}
|
||||||
|
|
||||||
# Test workspace and generate Codecov report.
|
# Test workspace and generate Codecov report.
|
||||||
test-coverage-codecov toolchain="": (test-coverage toolchain)
|
test-coverage-codecov: test-coverage
|
||||||
cargo {{ toolchain }} llvm-cov report --doctests --codecov --output-path=codecov.json
|
cargo {{ toolchain }} llvm-cov report --doctests --codecov --output-path=codecov.json
|
||||||
|
|
||||||
# Test workspace and generate LCOV report.
|
# Test workspace and generate LCOV report.
|
||||||
test-coverage-lcov toolchain="": (test-coverage toolchain)
|
test-coverage-lcov: test-coverage
|
||||||
cargo {{ toolchain }} llvm-cov report --doctests --lcov --output-path=lcov.info
|
cargo {{ toolchain }} llvm-cov report --doctests --lcov --output-path=lcov.info
|
||||||
|
|
||||||
# Document crates in workspace.
|
# Document crates in workspace.
|
||||||
|
Reference in New Issue
Block a user