mirror of https://github.com/fafhrd91/actix-web
Merge branch 'master' into scope_work
This commit is contained in:
commit
88883b781d
|
@ -45,7 +45,7 @@ jobs:
|
||||||
toolchain: ${{ matrix.version.version }}
|
toolchain: ${{ matrix.version.version }}
|
||||||
|
|
||||||
- name: Install cargo-hack
|
- name: Install cargo-hack
|
||||||
uses: taiki-e/install-action@v2.22.0
|
uses: taiki-e/install-action@v2.23.0
|
||||||
with:
|
with:
|
||||||
tool: cargo-hack
|
tool: cargo-hack
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ jobs:
|
||||||
|
|
||||||
- name: Clear the cargo caches
|
- name: Clear the cargo caches
|
||||||
run: |
|
run: |
|
||||||
cargo install cargo-cache --version 0.8.3 --no-default-features --features ci-autoclean
|
cargo --locked install cargo-cache --version 0.8.3 --no-default-features --features ci-autoclean
|
||||||
cargo-cache
|
cargo-cache
|
||||||
|
|
||||||
ci_feature_powerset_check:
|
ci_feature_powerset_check:
|
||||||
|
@ -85,7 +85,7 @@ jobs:
|
||||||
uses: actions-rust-lang/setup-rust-toolchain@v1.6.0
|
uses: actions-rust-lang/setup-rust-toolchain@v1.6.0
|
||||||
|
|
||||||
- name: Install cargo-hack
|
- name: Install cargo-hack
|
||||||
uses: taiki-e/install-action@v2.22.0
|
uses: taiki-e/install-action@v2.23.0
|
||||||
with:
|
with:
|
||||||
tool: cargo-hack
|
tool: cargo-hack
|
||||||
|
|
||||||
|
@ -106,7 +106,7 @@ jobs:
|
||||||
uses: actions-rust-lang/setup-rust-toolchain@v1.6.0
|
uses: actions-rust-lang/setup-rust-toolchain@v1.6.0
|
||||||
|
|
||||||
- name: Install nextest
|
- name: Install nextest
|
||||||
uses: taiki-e/install-action@v2.22.0
|
uses: taiki-e/install-action@v2.23.0
|
||||||
with:
|
with:
|
||||||
tool: nextest
|
tool: nextest
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ jobs:
|
||||||
toolchain: ${{ matrix.version.version }}
|
toolchain: ${{ matrix.version.version }}
|
||||||
|
|
||||||
- name: Install cargo-hack
|
- name: Install cargo-hack
|
||||||
uses: taiki-e/install-action@v2.22.0
|
uses: taiki-e/install-action@v2.23.0
|
||||||
with:
|
with:
|
||||||
tool: cargo-hack
|
tool: cargo-hack
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ jobs:
|
||||||
|
|
||||||
- name: Clear the cargo caches
|
- name: Clear the cargo caches
|
||||||
run: |
|
run: |
|
||||||
cargo install cargo-cache --version 0.8.3 --no-default-features --features ci-autoclean
|
cargo --locked install cargo-cache --version 0.8.3 --no-default-features --features ci-autoclean
|
||||||
cargo-cache
|
cargo-cache
|
||||||
|
|
||||||
io-uring:
|
io-uring:
|
||||||
|
|
|
@ -23,7 +23,7 @@ jobs:
|
||||||
components: llvm-tools-preview
|
components: llvm-tools-preview
|
||||||
|
|
||||||
- name: Install cargo-llvm-cov
|
- name: Install cargo-llvm-cov
|
||||||
uses: taiki-e/install-action@v2.22.0
|
uses: taiki-e/install-action@v2.23.0
|
||||||
with:
|
with:
|
||||||
tool: cargo-llvm-cov
|
tool: cargo-llvm-cov
|
||||||
|
|
||||||
|
|
|
@ -2,14 +2,25 @@
|
||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
### Changed
|
## 3.5.1
|
||||||
|
|
||||||
- Updated `zstd` dependency to `0.13`.
|
|
||||||
- Implemented `From<HeaderMap>` for `http::HeaderMap`.
|
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- Do not encode zero-sized response bodies
|
- Prevent hang when returning zero-sized response bodies through compression layer.
|
||||||
|
|
||||||
|
## 3.5.0
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Implement `From<HeaderMap>` for `http::HeaderMap`.
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Updated `zstd` dependency to `0.13`.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Prevent compression of zero-sized response bodies.
|
||||||
|
|
||||||
## 3.4.0
|
## 3.4.0
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "actix-http"
|
name = "actix-http"
|
||||||
version = "3.4.0"
|
version = "3.5.1"
|
||||||
authors = [
|
authors = [
|
||||||
"Nikolay Kim <fafhrd91@gmail.com>",
|
"Nikolay Kim <fafhrd91@gmail.com>",
|
||||||
"Rob Ede <robjtede@icloud.com>",
|
"Rob Ede <robjtede@icloud.com>",
|
||||||
|
|
|
@ -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.4.0)
|
[](https://docs.rs/actix-http/3.5.1)
|
||||||

|

|
||||||

|

|
||||||
<br />
|
<br />
|
||||||
[](https://deps.rs/crate/actix-http/3.4.0)
|
[](https://deps.rs/crate/actix-http/3.5.1)
|
||||||
[](https://crates.io/crates/actix-http)
|
[](https://crates.io/crates/actix-http)
|
||||||
[](https://discord.gg/NWpN5mmg3x)
|
[](https://discord.gg/NWpN5mmg3x)
|
||||||
|
|
||||||
|
|
|
@ -50,10 +50,21 @@ impl<B: MessageBody> Encoder<B> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn empty() -> Self {
|
||||||
|
Encoder {
|
||||||
|
body: EncoderBody::Full { body: Bytes::new() },
|
||||||
|
encoder: None,
|
||||||
|
fut: None,
|
||||||
|
eof: true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn response(encoding: ContentEncoding, head: &mut ResponseHead, body: B) -> Self {
|
pub fn response(encoding: ContentEncoding, head: &mut ResponseHead, body: B) -> Self {
|
||||||
// no need to compress an empty body
|
// no need to compress empty bodies
|
||||||
if matches!(body.size(), BodySize::None | BodySize::Sized(0)) {
|
match body.size() {
|
||||||
return Self::none();
|
BodySize::None => return Self::none(),
|
||||||
|
BodySize::Sized(0) => return Self::empty(),
|
||||||
|
_ => {}
|
||||||
}
|
}
|
||||||
|
|
||||||
let should_encode = !(head.headers().contains_key(&CONTENT_ENCODING)
|
let should_encode = !(head.headers().contains_key(&CONTENT_ENCODING)
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
## 0.5.2
|
||||||
|
|
||||||
- Minimum supported Rust version (MSRV) is now 1.68 due to transitive `time` dependency.
|
- Minimum supported Rust version (MSRV) is now 1.68 due to transitive `time` dependency.
|
||||||
|
|
||||||
## 0.5.1
|
## 0.5.1
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "actix-router"
|
name = "actix-router"
|
||||||
version = "0.5.1"
|
version = "0.5.2"
|
||||||
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>",
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
# `actix-router`
|
# `actix-router`
|
||||||
|
|
||||||
[](https://crates.io/crates/actix-router)
|
[](https://crates.io/crates/actix-router)
|
||||||
[](https://docs.rs/actix-router/0.5.1)
|
[](https://docs.rs/actix-router/0.5.2)
|
||||||

|

|
||||||

|

|
||||||
<br />
|
<br />
|
||||||
[](https://deps.rs/crate/actix-router/0.5.1)
|
[](https://deps.rs/crate/actix-router/0.5.2)
|
||||||
[](https://crates.io/crates/actix-router)
|
[](https://crates.io/crates/actix-router)
|
||||||
[](https://discord.gg/NWpN5mmg3x)
|
[](https://discord.gg/NWpN5mmg3x)
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ use std::{
|
||||||
ops::{DerefMut, Index},
|
ops::{DerefMut, Index},
|
||||||
};
|
};
|
||||||
|
|
||||||
use serde::de;
|
use serde::{de, Deserialize};
|
||||||
|
|
||||||
use crate::{de::PathDeserializer, Resource, ResourcePath};
|
use crate::{de::PathDeserializer, Resource, ResourcePath};
|
||||||
|
|
||||||
|
@ -24,8 +24,13 @@ impl Default for PathItem {
|
||||||
/// If resource path contains variable patterns, `Path` stores them.
|
/// If resource path contains variable patterns, `Path` stores them.
|
||||||
#[derive(Debug, Clone, Default)]
|
#[derive(Debug, Clone, Default)]
|
||||||
pub struct Path<T> {
|
pub struct Path<T> {
|
||||||
|
/// Full path representation.
|
||||||
path: T,
|
path: T,
|
||||||
|
|
||||||
|
/// Number of characters in `path` that have been processed into `segments`.
|
||||||
pub(crate) skip: u16,
|
pub(crate) skip: u16,
|
||||||
|
|
||||||
|
/// List of processed dynamic segments; name->value pairs.
|
||||||
pub(crate) segments: Vec<(Cow<'static, str>, PathItem)>,
|
pub(crate) segments: Vec<(Cow<'static, str>, PathItem)>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,8 +88,8 @@ impl<T: ResourcePath> Path<T> {
|
||||||
/// Set new path.
|
/// Set new path.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn set(&mut self, path: T) {
|
pub fn set(&mut self, path: T) {
|
||||||
self.skip = 0;
|
|
||||||
self.path = path;
|
self.path = path;
|
||||||
|
self.skip = 0;
|
||||||
self.segments.clear();
|
self.segments.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,7 +108,7 @@ impl<T: ResourcePath> Path<T> {
|
||||||
|
|
||||||
pub(crate) fn add(&mut self, name: impl Into<Cow<'static, str>>, value: PathItem) {
|
pub(crate) fn add(&mut self, name: impl Into<Cow<'static, str>>, value: PathItem) {
|
||||||
match value {
|
match value {
|
||||||
PathItem::Static(s) => self.segments.push((name.into(), PathItem::Static(s))),
|
PathItem::Static(seg) => self.segments.push((name.into(), PathItem::Static(seg))),
|
||||||
PathItem::Segment(begin, end) => self.segments.push((
|
PathItem::Segment(begin, end) => self.segments.push((
|
||||||
name.into(),
|
name.into(),
|
||||||
PathItem::Segment(self.skip + begin, self.skip + end),
|
PathItem::Segment(self.skip + begin, self.skip + end),
|
||||||
|
@ -168,9 +173,13 @@ impl<T: ResourcePath> Path<T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Try to deserialize matching parameters to a specified type `U`
|
/// Deserializes matching parameters to a specified type `U`.
|
||||||
pub fn load<'de, U: serde::Deserialize<'de>>(&'de self) -> Result<U, de::value::Error> {
|
///
|
||||||
de::Deserialize::deserialize(PathDeserializer::new(self))
|
/// # Errors
|
||||||
|
///
|
||||||
|
/// Returns error when dynamic path segments cannot be deserialized into a `U` type.
|
||||||
|
pub fn load<'de, U: Deserialize<'de>>(&'de self) -> Result<U, de::value::Error> {
|
||||||
|
Deserialize::deserialize(PathDeserializer::new(self))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
## 4.4.1
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- Updated `zstd` dependency to `0.13`.
|
- Updated `zstd` dependency to `0.13`.
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "actix-web"
|
name = "actix-web"
|
||||||
version = "4.4.0"
|
version = "4.4.1"
|
||||||
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>",
|
"Nikolay Kim <fafhrd91@gmail.com>",
|
||||||
|
@ -75,7 +75,7 @@ actix-service = "2"
|
||||||
actix-utils = "3"
|
actix-utils = "3"
|
||||||
actix-tls = { version = "3.1", default-features = false, optional = true }
|
actix-tls = { version = "3.1", default-features = false, optional = true }
|
||||||
|
|
||||||
actix-http = { version = "3.4", features = ["ws"] }
|
actix-http = { version = "3.5", features = ["ws"] }
|
||||||
actix-router = "0.5"
|
actix-router = "0.5"
|
||||||
actix-web-codegen = { version = "4.2", optional = true }
|
actix-web-codegen = { version = "4.2", optional = true }
|
||||||
|
|
||||||
|
|
|
@ -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.4.0)
|
[](https://docs.rs/actix-web/4.4.1)
|
||||||

|

|
||||||

|

|
||||||
[](https://deps.rs/crate/actix-web/4.4.0)
|
[](https://deps.rs/crate/actix-web/4.4.1)
|
||||||
<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)
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
## 3.3.0
|
||||||
|
|
||||||
- Update `trust-dns-resolver` dependency to `0.23`.
|
- Update `trust-dns-resolver` dependency to `0.23`.
|
||||||
- Updated `zstd` dependency to `0.13`.
|
- Updated `zstd` dependency to `0.13`.
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "awc"
|
name = "awc"
|
||||||
version = "3.2.0"
|
version = "3.3.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"]
|
||||||
|
@ -61,7 +61,7 @@ dangerous-h2c = []
|
||||||
[dependencies]
|
[dependencies]
|
||||||
actix-codec = "0.5"
|
actix-codec = "0.5"
|
||||||
actix-service = "2"
|
actix-service = "2"
|
||||||
actix-http = { version = "3.4", features = ["http2", "ws"] }
|
actix-http = { version = "3.5", features = ["http2", "ws"] }
|
||||||
actix-rt = { version = "2.1", default-features = false }
|
actix-rt = { version = "2.1", default-features = false }
|
||||||
actix-tls = { version = "3.1", features = ["connect", "uri"] }
|
actix-tls = { version = "3.1", features = ["connect", "uri"] }
|
||||||
actix-utils = "3"
|
actix-utils = "3"
|
||||||
|
@ -94,7 +94,7 @@ tls-rustls-0_21 = { package = "rustls", version = "0.21", optional = true, featu
|
||||||
trust-dns-resolver = { version = "0.23", optional = true }
|
trust-dns-resolver = { version = "0.23", optional = true }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
actix-http = { version = "3.4", features = ["openssl"] }
|
actix-http = { version = "3.5", features = ["openssl"] }
|
||||||
actix-http-test = { version = "3", features = ["openssl"] }
|
actix-http-test = { version = "3", features = ["openssl"] }
|
||||||
actix-server = "2"
|
actix-server = "2"
|
||||||
actix-test = { version = "0.1", features = ["openssl", "rustls-0_21"] }
|
actix-test = { version = "0.1", features = ["openssl", "rustls-0_21"] }
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
> Async HTTP and WebSocket client library.
|
> Async HTTP and WebSocket client library.
|
||||||
|
|
||||||
[](https://crates.io/crates/awc)
|
[](https://crates.io/crates/awc)
|
||||||
[](https://docs.rs/awc/3.2.0)
|
[](https://docs.rs/awc/3.3.0)
|
||||||

|

|
||||||
[](https://deps.rs/crate/awc/3.2.0)
|
[](https://deps.rs/crate/awc/3.3.0)
|
||||||
[](https://discord.gg/NWpN5mmg3x)
|
[](https://discord.gg/NWpN5mmg3x)
|
||||||
|
|
||||||
## Documentation & Resources
|
## Documentation & Resources
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
# requires github cli tool for automatic release draft creation
|
# requires github cli tool for automatic release draft creation
|
||||||
|
|
||||||
set -euo pipefail
|
set -eEuo pipefail
|
||||||
|
|
||||||
DIR=$1
|
DIR=$1
|
||||||
|
|
||||||
|
@ -132,6 +132,7 @@ fi
|
||||||
|
|
||||||
if [ $MACOS ]; then
|
if [ $MACOS ]; then
|
||||||
printf "chore($PACKAGE_NAME): prepare release $NEW_VERSION" | pbcopy
|
printf "chore($PACKAGE_NAME): prepare release $NEW_VERSION" | pbcopy
|
||||||
|
echo "placed the recommended commit message on the clipboard"
|
||||||
else
|
else
|
||||||
echo
|
echo
|
||||||
echo "commit message:"
|
echo "commit message:"
|
||||||
|
|
Loading…
Reference in New Issue