mirror of https://github.com/fafhrd91/actix-web
Merge branch 'master' into introspection
This commit is contained in:
commit
3506512ed9
|
@ -32,7 +32,7 @@ jobs:
|
|||
|
||||
- name: Install nasm
|
||||
if: matrix.target.os == 'windows-latest'
|
||||
uses: ilammy/setup-nasm@v1.5.1
|
||||
uses: ilammy/setup-nasm@v1.5.2
|
||||
|
||||
- name: Install OpenSSL
|
||||
if: matrix.target.os == 'windows-latest'
|
||||
|
@ -44,12 +44,12 @@ jobs:
|
|||
echo "RUSTFLAGS=-C target-feature=+crt-static" >> $GITHUB_ENV
|
||||
|
||||
- name: Install Rust (${{ matrix.version.name }})
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1.11.0
|
||||
with:
|
||||
toolchain: ${{ matrix.version.version }}
|
||||
|
||||
- name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean
|
||||
uses: taiki-e/install-action@v2.49.0
|
||||
uses: taiki-e/install-action@v2.49.17
|
||||
with:
|
||||
tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean
|
||||
|
||||
|
@ -80,10 +80,10 @@ jobs:
|
|||
uses: rui314/setup-mold@v1
|
||||
|
||||
- name: Install Rust
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1.11.0
|
||||
|
||||
- name: Install just, cargo-hack
|
||||
uses: taiki-e/install-action@v2.49.0
|
||||
uses: taiki-e/install-action@v2.49.17
|
||||
with:
|
||||
tool: just,cargo-hack
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ jobs:
|
|||
|
||||
- name: Install nasm
|
||||
if: matrix.target.os == 'windows-latest'
|
||||
uses: ilammy/setup-nasm@v1.5.1
|
||||
uses: ilammy/setup-nasm@v1.5.2
|
||||
|
||||
- name: Install OpenSSL
|
||||
if: matrix.target.os == 'windows-latest'
|
||||
|
@ -59,12 +59,12 @@ jobs:
|
|||
uses: rui314/setup-mold@v1
|
||||
|
||||
- name: Install Rust (${{ matrix.version.name }})
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1.11.0
|
||||
with:
|
||||
toolchain: ${{ matrix.version.version }}
|
||||
|
||||
- name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean
|
||||
uses: taiki-e/install-action@v2.49.0
|
||||
uses: taiki-e/install-action@v2.49.17
|
||||
with:
|
||||
tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean
|
||||
|
||||
|
@ -92,7 +92,7 @@ jobs:
|
|||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1.11.0
|
||||
with:
|
||||
toolchain: nightly
|
||||
|
||||
|
@ -108,12 +108,12 @@ jobs:
|
|||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust (nightly)
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1.11.0
|
||||
with:
|
||||
toolchain: nightly
|
||||
|
||||
- name: Install just
|
||||
uses: taiki-e/install-action@v2.49.0
|
||||
uses: taiki-e/install-action@v2.49.17
|
||||
with:
|
||||
tool: just
|
||||
|
||||
|
|
|
@ -18,13 +18,13 @@ jobs:
|
|||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust (nightly)
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1.11.0
|
||||
with:
|
||||
toolchain: nightly
|
||||
components: llvm-tools
|
||||
|
||||
- name: Install just, cargo-llvm-cov, cargo-nextest
|
||||
uses: taiki-e/install-action@v2.49.0
|
||||
uses: taiki-e/install-action@v2.49.17
|
||||
with:
|
||||
tool: just,cargo-llvm-cov,cargo-nextest
|
||||
|
||||
|
@ -32,7 +32,7 @@ jobs:
|
|||
run: just test-coverage-codecov
|
||||
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v5.3.1
|
||||
uses: codecov/codecov-action@v5.4.0
|
||||
with:
|
||||
files: codecov.json
|
||||
fail_ci_if_error: true
|
||||
|
|
|
@ -18,7 +18,7 @@ jobs:
|
|||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust (nightly)
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1.11.0
|
||||
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.10.1
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1.11.0
|
||||
with:
|
||||
components: clippy
|
||||
|
||||
|
@ -55,7 +55,7 @@ jobs:
|
|||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust (nightly)
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1.11.0
|
||||
with:
|
||||
toolchain: nightly
|
||||
components: rust-docs
|
||||
|
@ -72,12 +72,12 @@ jobs:
|
|||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust (${{ vars.RUST_VERSION_EXTERNAL_TYPES }})
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1.11.0
|
||||
with:
|
||||
toolchain: ${{ vars.RUST_VERSION_EXTERNAL_TYPES }}
|
||||
|
||||
- name: Install just
|
||||
uses: taiki-e/install-action@v2.49.0
|
||||
uses: taiki-e/install-action@v2.49.17
|
||||
with:
|
||||
tool: just
|
||||
|
||||
|
|
|
@ -2,10 +2,14 @@
|
|||
|
||||
## Unreleased
|
||||
|
||||
## 3.10.0
|
||||
|
||||
### Added
|
||||
|
||||
- Add `header::CLEAR_SITE_DATA` constant.
|
||||
- Add `Extensions::get_or_insert[_with]()` methods.
|
||||
- Implement `From<Bytes>` for `Payload`.
|
||||
- Implement `From<Vec<u8>>` for `Payload`.
|
||||
|
||||
### Changed
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "actix-http"
|
||||
version = "3.9.0"
|
||||
version = "3.10.0"
|
||||
authors = [
|
||||
"Nikolay Kim <fafhrd91@gmail.com>",
|
||||
"Rob Ede <robjtede@icloud.com>",
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
<!-- prettier-ignore-start -->
|
||||
|
||||
[](https://crates.io/crates/actix-http)
|
||||
[](https://docs.rs/actix-http/3.9.0)
|
||||
[](https://docs.rs/actix-http/3.10.0)
|
||||

|
||||

|
||||
<br />
|
||||
[](https://deps.rs/crate/actix-http/3.9.0)
|
||||
[](https://deps.rs/crate/actix-http/3.10.0)
|
||||
[](https://crates.io/crates/actix-http)
|
||||
[](https://discord.gg/NWpN5mmg3x)
|
||||
|
||||
|
|
|
@ -41,13 +41,31 @@ pin_project! {
|
|||
}
|
||||
|
||||
impl<S> From<crate::h1::Payload> for Payload<S> {
|
||||
#[inline]
|
||||
fn from(payload: crate::h1::Payload) -> Self {
|
||||
Payload::H1 { payload }
|
||||
}
|
||||
}
|
||||
|
||||
impl<S> From<Bytes> for Payload<S> {
|
||||
#[inline]
|
||||
fn from(bytes: Bytes) -> Self {
|
||||
let (_, mut pl) = crate::h1::Payload::create(true);
|
||||
pl.unread_data(bytes);
|
||||
self::Payload::from(pl)
|
||||
}
|
||||
}
|
||||
|
||||
impl<S> From<Vec<u8>> for Payload<S> {
|
||||
#[inline]
|
||||
fn from(vec: Vec<u8>) -> Self {
|
||||
Payload::from(Bytes::from(vec))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "http2")]
|
||||
impl<S> From<crate::h2::Payload> for Payload<S> {
|
||||
#[inline]
|
||||
fn from(payload: crate::h2::Payload) -> Self {
|
||||
Payload::H2 { payload }
|
||||
}
|
||||
|
@ -55,6 +73,7 @@ impl<S> From<crate::h2::Payload> for Payload<S> {
|
|||
|
||||
#[cfg(feature = "http2")]
|
||||
impl<S> From<::h2::RecvStream> for Payload<S> {
|
||||
#[inline]
|
||||
fn from(stream: ::h2::RecvStream) -> Self {
|
||||
Payload::H2 {
|
||||
payload: crate::h2::Payload::new(stream),
|
||||
|
@ -63,13 +82,15 @@ impl<S> From<::h2::RecvStream> for Payload<S> {
|
|||
}
|
||||
|
||||
impl From<BoxedPayloadStream> for Payload {
|
||||
#[inline]
|
||||
fn from(payload: BoxedPayloadStream) -> Self {
|
||||
Payload::Stream { payload }
|
||||
}
|
||||
}
|
||||
|
||||
impl<S> Payload<S> {
|
||||
/// Takes current payload and replaces it with `None` value
|
||||
/// Takes current payload and replaces it with `None` value.
|
||||
#[must_use]
|
||||
pub fn take(&mut self) -> Payload<S> {
|
||||
mem::replace(self, Payload::None)
|
||||
}
|
||||
|
|
|
@ -3,7 +3,23 @@
|
|||
## Unreleased
|
||||
|
||||
- Add `resources-introspection` feature for retrieving configured route paths and HTTP methods.
|
||||
|
||||
## 4.10.2
|
||||
|
||||
- No significant changes since `4.10.1`.
|
||||
|
||||
## 4.10.1
|
||||
|
||||
- No significant changes since `4.10.0`.
|
||||
|
||||
## 4.10.0
|
||||
|
||||
### Added
|
||||
|
||||
- Implement `Responder` for `Result<(), E: Into<Error>>`. Returning `Ok(())` responds with HTTP 204 No Content.
|
||||
|
||||
### Changed
|
||||
|
||||
- On Windows, an error is now returned from `HttpServer::bind()` (or TLS variants) when binding to a socket that's already in use.
|
||||
- Update `brotli` dependency to `7`.
|
||||
- Minimum supported Rust version (MSRV) is now 1.75.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "actix-web"
|
||||
version = "4.9.0"
|
||||
version = "4.10.2"
|
||||
description = "Actix Web is a powerful, pragmatic, and extremely fast web framework for Rust"
|
||||
authors = [
|
||||
"Nikolay Kim <fafhrd91@gmail.com>",
|
||||
|
@ -140,7 +140,7 @@ actix-service = "2"
|
|||
actix-utils = "3"
|
||||
actix-tls = { version = "3.4", default-features = false, optional = true }
|
||||
|
||||
actix-http = { version = "3.7", features = ["ws"] }
|
||||
actix-http = { version = "3.10", features = ["ws"] }
|
||||
actix-router = { version = "0.5.3", default-features = false, features = ["http"] }
|
||||
actix-web-codegen = { version = "4.3", optional = true, default-features = false }
|
||||
|
||||
|
@ -148,7 +148,7 @@ bytes = "1"
|
|||
bytestring = "1"
|
||||
cfg-if = "1"
|
||||
cookie = { version = "0.16", features = ["percent-encode"], optional = true }
|
||||
derive_more = { version = "2", features = ["display", "error", "from"] }
|
||||
derive_more = { version = "2", features = ["as_ref", "deref", "deref_mut", "display", "error", "from"] }
|
||||
encoding_rs = "0.8"
|
||||
foldhash = "0.1"
|
||||
futures-core = { version = "0.3.17", default-features = false }
|
||||
|
|
|
@ -8,10 +8,10 @@
|
|||
<!-- prettier-ignore-start -->
|
||||
|
||||
[](https://crates.io/crates/actix-web)
|
||||
[](https://docs.rs/actix-web/4.9.0)
|
||||
[](https://docs.rs/actix-web/4.10.2)
|
||||

|
||||

|
||||
[](https://deps.rs/crate/actix-web/4.9.0)
|
||||
[](https://deps.rs/crate/actix-web/4.10.2)
|
||||
<br />
|
||||
[](https://github.com/actix/actix-web/actions/workflows/ci.yml)
|
||||
[](https://codecov.io/gh/actix/actix-web)
|
||||
|
|
|
@ -267,7 +267,7 @@ impl DispositionParam {
|
|||
/// parameters: vec![DispositionParam::FilenameExt(ExtendedValue {
|
||||
/// charset: Charset::Iso_8859_1, // The character set for the bytes of the filename
|
||||
/// language_tag: None, // The optional language tag (see `language-tag` crate)
|
||||
/// value: b"\xa9 Copyright 1989.txt".to_vec(), // the actual bytes of the filename
|
||||
/// value: b"\xA9 Ferris 2011.txt".to_vec(), // the actual bytes of the filename
|
||||
/// })],
|
||||
/// };
|
||||
/// assert!(cd1.is_attachment());
|
||||
|
|
|
@ -238,7 +238,7 @@ where
|
|||
match res {
|
||||
Ok(bytes) => {
|
||||
let fallback = bytes.clone();
|
||||
let left = L::from_request(this.req, &mut payload_from_bytes(bytes));
|
||||
let left = L::from_request(this.req, &mut dev::Payload::from(bytes));
|
||||
EitherExtractState::Left { left, fallback }
|
||||
}
|
||||
Err(err) => break Err(EitherExtractError::Bytes(err)),
|
||||
|
@ -251,7 +251,7 @@ where
|
|||
Err(left_err) => {
|
||||
let right = R::from_request(
|
||||
this.req,
|
||||
&mut payload_from_bytes(mem::take(fallback)),
|
||||
&mut dev::Payload::from(mem::take(fallback)),
|
||||
);
|
||||
EitherExtractState::Right {
|
||||
left_err: Some(left_err),
|
||||
|
@ -276,12 +276,6 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
fn payload_from_bytes(bytes: Bytes) -> dev::Payload {
|
||||
let (_, mut h1_payload) = actix_http::h1::Payload::create(true);
|
||||
h1_payload.unread_data(bytes);
|
||||
dev::Payload::from(h1_payload)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
|
|
@ -2,10 +2,12 @@
|
|||
|
||||
## Unreleased
|
||||
|
||||
- Update `brotli` dependency to `7`.
|
||||
## 3.6.0
|
||||
|
||||
- Prevent panics on connection pool drop when Tokio runtime is shutdown early.
|
||||
- Minimum supported Rust version (MSRV) is now 1.75.
|
||||
- Do not send `Host` header on HTTP/2 requests, as it is not required, and some web servers may reject it.
|
||||
- Update `brotli` dependency to `7`.
|
||||
- Minimum supported Rust version (MSRV) is now 1.75.
|
||||
|
||||
## 3.5.1
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "awc"
|
||||
version = "3.5.1"
|
||||
version = "3.6.0"
|
||||
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
||||
description = "Async HTTP and WebSocket client library"
|
||||
keywords = ["actix", "http", "framework", "async", "web"]
|
||||
|
@ -98,7 +98,7 @@ dangerous-h2c = []
|
|||
[dependencies]
|
||||
actix-codec = "0.5"
|
||||
actix-service = "2"
|
||||
actix-http = { version = "3.7", features = ["http2", "ws"] }
|
||||
actix-http = { version = "3.10", features = ["http2", "ws"] }
|
||||
actix-rt = { version = "2.1", default-features = false }
|
||||
actix-tls = { version = "3.4", features = ["connect", "uri"] }
|
||||
actix-utils = "3"
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
<!-- prettier-ignore-start -->
|
||||
|
||||
[](https://crates.io/crates/awc)
|
||||
[](https://docs.rs/awc/3.5.1)
|
||||
[](https://docs.rs/awc/3.6.0)
|
||||

|
||||
[](https://deps.rs/crate/awc/3.5.1)
|
||||
[](https://deps.rs/crate/awc/3.6.0)
|
||||
[](https://discord.gg/NWpN5mmg3x)
|
||||
|
||||
<!-- prettier-ignore-end -->
|
||||
|
|
|
@ -89,9 +89,9 @@ impl Connector<()> {
|
|||
/// # Panics
|
||||
///
|
||||
/// - When the `rustls-0_23-webpki-roots` or `rustls-0_23-native-roots` features are enabled
|
||||
/// and no default crypto provider has been loaded, this method will panic.
|
||||
/// and no default crypto provider has been loaded, this method will panic.
|
||||
/// - When the `rustls-0_23-native-roots` or `rustls-0_22-native-roots` features are enabled
|
||||
/// and the runtime system has no native root certificates, this method will panic.
|
||||
/// and the runtime system has no native root certificates, this method will panic.
|
||||
#[allow(clippy::new_ret_no_self, clippy::let_unit_value)]
|
||||
pub fn new() -> Connector<
|
||||
impl Service<
|
||||
|
|
|
@ -65,9 +65,7 @@ impl TestResponse {
|
|||
|
||||
/// Set response's payload
|
||||
pub fn set_payload<B: Into<Bytes>>(mut self, data: B) -> Self {
|
||||
let (_, mut payload) = h1::Payload::create(true);
|
||||
payload.unread_data(data.into());
|
||||
self.payload = Some(payload.into());
|
||||
self.payload = Some(Payload::from(data.into()));
|
||||
self
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue