mirror of https://github.com/fafhrd91/actix-web
Merge branch 'master' into scope_work
This commit is contained in:
commit
88883b781d
.github/workflows
actix-http
actix-router
actix-web
awc
scripts
|
@ -45,7 +45,7 @@ jobs:
|
|||
toolchain: ${{ matrix.version.version }}
|
||||
|
||||
- name: Install cargo-hack
|
||||
uses: taiki-e/install-action@v2.22.0
|
||||
uses: taiki-e/install-action@v2.23.0
|
||||
with:
|
||||
tool: cargo-hack
|
||||
|
||||
|
@ -71,7 +71,7 @@ jobs:
|
|||
|
||||
- name: Clear the cargo caches
|
||||
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
|
||||
|
||||
ci_feature_powerset_check:
|
||||
|
@ -85,7 +85,7 @@ jobs:
|
|||
uses: actions-rust-lang/setup-rust-toolchain@v1.6.0
|
||||
|
||||
- name: Install cargo-hack
|
||||
uses: taiki-e/install-action@v2.22.0
|
||||
uses: taiki-e/install-action@v2.23.0
|
||||
with:
|
||||
tool: cargo-hack
|
||||
|
||||
|
@ -106,7 +106,7 @@ jobs:
|
|||
uses: actions-rust-lang/setup-rust-toolchain@v1.6.0
|
||||
|
||||
- name: Install nextest
|
||||
uses: taiki-e/install-action@v2.22.0
|
||||
uses: taiki-e/install-action@v2.23.0
|
||||
with:
|
||||
tool: nextest
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ jobs:
|
|||
toolchain: ${{ matrix.version.version }}
|
||||
|
||||
- name: Install cargo-hack
|
||||
uses: taiki-e/install-action@v2.22.0
|
||||
uses: taiki-e/install-action@v2.23.0
|
||||
with:
|
||||
tool: cargo-hack
|
||||
|
||||
|
@ -83,7 +83,7 @@ jobs:
|
|||
|
||||
- name: Clear the cargo caches
|
||||
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
|
||||
|
||||
io-uring:
|
||||
|
|
|
@ -23,7 +23,7 @@ jobs:
|
|||
components: llvm-tools-preview
|
||||
|
||||
- name: Install cargo-llvm-cov
|
||||
uses: taiki-e/install-action@v2.22.0
|
||||
uses: taiki-e/install-action@v2.23.0
|
||||
with:
|
||||
tool: cargo-llvm-cov
|
||||
|
||||
|
|
|
@ -2,14 +2,25 @@
|
|||
|
||||
## Unreleased
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated `zstd` dependency to `0.13`.
|
||||
- Implemented `From<HeaderMap>` for `http::HeaderMap`.
|
||||
## 3.5.1
|
||||
|
||||
### 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
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "actix-http"
|
||||
version = "3.4.0"
|
||||
version = "3.5.1"
|
||||
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.4.0)
|
||||
[](https://docs.rs/actix-http/3.5.1)
|
||||

|
||||

|
||||
<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://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 {
|
||||
// no need to compress an empty body
|
||||
if matches!(body.size(), BodySize::None | BodySize::Sized(0)) {
|
||||
return Self::none();
|
||||
// no need to compress empty bodies
|
||||
match body.size() {
|
||||
BodySize::None => return Self::none(),
|
||||
BodySize::Sized(0) => return Self::empty(),
|
||||
_ => {}
|
||||
}
|
||||
|
||||
let should_encode = !(head.headers().contains_key(&CONTENT_ENCODING)
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
## Unreleased
|
||||
|
||||
## 0.5.2
|
||||
|
||||
- Minimum supported Rust version (MSRV) is now 1.68 due to transitive `time` dependency.
|
||||
|
||||
## 0.5.1
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "actix-router"
|
||||
version = "0.5.1"
|
||||
version = "0.5.2"
|
||||
authors = [
|
||||
"Nikolay Kim <fafhrd91@gmail.com>",
|
||||
"Ali MJ Al-Nasrawy <alimjalnasrawy@gmail.com>",
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# `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 />
|
||||
[](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://discord.gg/NWpN5mmg3x)
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ use std::{
|
|||
ops::{DerefMut, Index},
|
||||
};
|
||||
|
||||
use serde::de;
|
||||
use serde::{de, Deserialize};
|
||||
|
||||
use crate::{de::PathDeserializer, Resource, ResourcePath};
|
||||
|
||||
|
@ -24,8 +24,13 @@ impl Default for PathItem {
|
|||
/// If resource path contains variable patterns, `Path` stores them.
|
||||
#[derive(Debug, Clone, Default)]
|
||||
pub struct Path<T> {
|
||||
/// Full path representation.
|
||||
path: T,
|
||||
|
||||
/// Number of characters in `path` that have been processed into `segments`.
|
||||
pub(crate) skip: u16,
|
||||
|
||||
/// List of processed dynamic segments; name->value pairs.
|
||||
pub(crate) segments: Vec<(Cow<'static, str>, PathItem)>,
|
||||
}
|
||||
|
||||
|
@ -83,8 +88,8 @@ impl<T: ResourcePath> Path<T> {
|
|||
/// Set new path.
|
||||
#[inline]
|
||||
pub fn set(&mut self, path: T) {
|
||||
self.skip = 0;
|
||||
self.path = path;
|
||||
self.skip = 0;
|
||||
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) {
|
||||
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((
|
||||
name.into(),
|
||||
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`
|
||||
pub fn load<'de, U: serde::Deserialize<'de>>(&'de self) -> Result<U, de::value::Error> {
|
||||
de::Deserialize::deserialize(PathDeserializer::new(self))
|
||||
/// Deserializes matching parameters to a specified type `U`.
|
||||
///
|
||||
/// # 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
|
||||
|
||||
## 4.4.1
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated `zstd` dependency to `0.13`.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
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"
|
||||
authors = [
|
||||
"Nikolay Kim <fafhrd91@gmail.com>",
|
||||
|
@ -75,7 +75,7 @@ actix-service = "2"
|
|||
actix-utils = "3"
|
||||
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-web-codegen = { version = "4.2", optional = true }
|
||||
|
||||
|
|
|
@ -8,10 +8,10 @@
|
|||
<!-- prettier-ignore-start -->
|
||||
|
||||
[](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 />
|
||||
[](https://github.com/actix/actix-web/actions/workflows/ci.yml)
|
||||
[](https://codecov.io/gh/actix/actix-web)
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
## Unreleased
|
||||
|
||||
## 3.3.0
|
||||
|
||||
- Update `trust-dns-resolver` dependency to `0.23`.
|
||||
- Updated `zstd` dependency to `0.13`.
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "awc"
|
||||
version = "3.2.0"
|
||||
version = "3.3.0"
|
||||
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
||||
description = "Async HTTP and WebSocket client library"
|
||||
keywords = ["actix", "http", "framework", "async", "web"]
|
||||
|
@ -61,7 +61,7 @@ dangerous-h2c = []
|
|||
[dependencies]
|
||||
actix-codec = "0.5"
|
||||
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-tls = { version = "3.1", features = ["connect", "uri"] }
|
||||
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 }
|
||||
|
||||
[dev-dependencies]
|
||||
actix-http = { version = "3.4", features = ["openssl"] }
|
||||
actix-http = { version = "3.5", features = ["openssl"] }
|
||||
actix-http-test = { version = "3", features = ["openssl"] }
|
||||
actix-server = "2"
|
||||
actix-test = { version = "0.1", features = ["openssl", "rustls-0_21"] }
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
> Async HTTP and WebSocket client library.
|
||||
|
||||
[](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)
|
||||
|
||||
## Documentation & Resources
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
# requires github cli tool for automatic release draft creation
|
||||
|
||||
set -euo pipefail
|
||||
set -eEuo pipefail
|
||||
|
||||
DIR=$1
|
||||
|
||||
|
@ -132,6 +132,7 @@ fi
|
|||
|
||||
if [ $MACOS ]; then
|
||||
printf "chore($PACKAGE_NAME): prepare release $NEW_VERSION" | pbcopy
|
||||
echo "placed the recommended commit message on the clipboard"
|
||||
else
|
||||
echo
|
||||
echo "commit message:"
|
||||
|
|
Loading…
Reference in New Issue