diff --git a/.github/workflows/ci-post-merge.yml b/.github/workflows/ci-post-merge.yml index 4c4a3404f..f135cd171 100644 --- a/.github/workflows/ci-post-merge.yml +++ b/.github/workflows/ci-post-merge.yml @@ -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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5627865c1..721fc0378 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index c451df22a..927ac86bb 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -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 diff --git a/actix-http/CHANGES.md b/actix-http/CHANGES.md index eadd5c515..994c91a83 100644 --- a/actix-http/CHANGES.md +++ b/actix-http/CHANGES.md @@ -2,14 +2,25 @@ ## Unreleased -### Changed - -- Updated `zstd` dependency to `0.13`. -- Implemented `From` 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` for `http::HeaderMap`. + +### Changed + +- Updated `zstd` dependency to `0.13`. + +### Fixed + +- Prevent compression of zero-sized response bodies. ## 3.4.0 diff --git a/actix-http/Cargo.toml b/actix-http/Cargo.toml index 8476d9086..6c53f35cc 100644 --- a/actix-http/Cargo.toml +++ b/actix-http/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "actix-http" -version = "3.4.0" +version = "3.5.1" authors = [ "Nikolay Kim ", "Rob Ede ", diff --git a/actix-http/README.md b/actix-http/README.md index 7d499f4b3..9d80c10c4 100644 --- a/actix-http/README.md +++ b/actix-http/README.md @@ -5,11 +5,11 @@ [![crates.io](https://img.shields.io/crates/v/actix-http?label=latest)](https://crates.io/crates/actix-http) -[![Documentation](https://docs.rs/actix-http/badge.svg?version=3.4.0)](https://docs.rs/actix-http/3.4.0) +[![Documentation](https://docs.rs/actix-http/badge.svg?version=3.5.1)](https://docs.rs/actix-http/3.5.1) ![Version](https://img.shields.io/badge/rustc-1.68+-ab6000.svg) ![MIT or Apache 2.0 licensed](https://img.shields.io/crates/l/actix-http.svg)
-[![dependency status](https://deps.rs/crate/actix-http/3.4.0/status.svg)](https://deps.rs/crate/actix-http/3.4.0) +[![dependency status](https://deps.rs/crate/actix-http/3.5.1/status.svg)](https://deps.rs/crate/actix-http/3.5.1) [![Download](https://img.shields.io/crates/d/actix-http.svg)](https://crates.io/crates/actix-http) [![Chat on Discord](https://img.shields.io/discord/771444961383153695?label=chat&logo=discord)](https://discord.gg/NWpN5mmg3x) diff --git a/actix-http/src/encoding/encoder.rs b/actix-http/src/encoding/encoder.rs index e084aa564..180927ac6 100644 --- a/actix-http/src/encoding/encoder.rs +++ b/actix-http/src/encoding/encoder.rs @@ -50,10 +50,21 @@ impl Encoder { } } + 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) diff --git a/actix-router/CHANGES.md b/actix-router/CHANGES.md index 31316ff47..a855c0074 100644 --- a/actix-router/CHANGES.md +++ b/actix-router/CHANGES.md @@ -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 diff --git a/actix-router/Cargo.toml b/actix-router/Cargo.toml index 8a404dd20..de39944cc 100644 --- a/actix-router/Cargo.toml +++ b/actix-router/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "actix-router" -version = "0.5.1" +version = "0.5.2" authors = [ "Nikolay Kim ", "Ali MJ Al-Nasrawy ", diff --git a/actix-router/README.md b/actix-router/README.md index 15a449c44..7dc0c9010 100644 --- a/actix-router/README.md +++ b/actix-router/README.md @@ -1,11 +1,11 @@ # `actix-router` [![crates.io](https://img.shields.io/crates/v/actix-router?label=latest)](https://crates.io/crates/actix-router) -[![Documentation](https://docs.rs/actix-router/badge.svg?version=0.5.1)](https://docs.rs/actix-router/0.5.1) +[![Documentation](https://docs.rs/actix-router/badge.svg?version=0.5.2)](https://docs.rs/actix-router/0.5.2) ![Version](https://img.shields.io/badge/rustc-1.68+-ab6000.svg) ![MIT or Apache 2.0 licensed](https://img.shields.io/crates/l/actix-router.svg)
-[![dependency status](https://deps.rs/crate/actix-router/0.5.1/status.svg)](https://deps.rs/crate/actix-router/0.5.1) +[![dependency status](https://deps.rs/crate/actix-router/0.5.2/status.svg)](https://deps.rs/crate/actix-router/0.5.2) [![Download](https://img.shields.io/crates/d/actix-router.svg)](https://crates.io/crates/actix-router) [![Chat on Discord](https://img.shields.io/discord/771444961383153695?label=chat&logo=discord)](https://discord.gg/NWpN5mmg3x) diff --git a/actix-router/src/path.rs b/actix-router/src/path.rs index dc4150ddc..467420cd3 100644 --- a/actix-router/src/path.rs +++ b/actix-router/src/path.rs @@ -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 { + /// 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 Path { /// 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 Path { pub(crate) fn add(&mut self, name: impl Into>, 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 Path { } } - /// Try to deserialize matching parameters to a specified type `U` - pub fn load<'de, U: serde::Deserialize<'de>>(&'de self) -> Result { - 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 { + Deserialize::deserialize(PathDeserializer::new(self)) } } diff --git a/actix-web/CHANGES.md b/actix-web/CHANGES.md index 953befb7f..674c834ad 100644 --- a/actix-web/CHANGES.md +++ b/actix-web/CHANGES.md @@ -2,6 +2,8 @@ ## Unreleased +## 4.4.1 + ### Changed - Updated `zstd` dependency to `0.13`. diff --git a/actix-web/Cargo.toml b/actix-web/Cargo.toml index d9cf0b94f..d1fc9c916 100644 --- a/actix-web/Cargo.toml +++ b/actix-web/Cargo.toml @@ -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 ", @@ -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 } diff --git a/actix-web/README.md b/actix-web/README.md index e83397657..80ae21238 100644 --- a/actix-web/README.md +++ b/actix-web/README.md @@ -8,10 +8,10 @@ [![crates.io](https://img.shields.io/crates/v/actix-web?label=latest)](https://crates.io/crates/actix-web) -[![Documentation](https://docs.rs/actix-web/badge.svg?version=4.4.0)](https://docs.rs/actix-web/4.4.0) +[![Documentation](https://docs.rs/actix-web/badge.svg?version=4.4.1)](https://docs.rs/actix-web/4.4.1) ![MSRV](https://img.shields.io/badge/rustc-1.68+-ab6000.svg) ![MIT or Apache 2.0 licensed](https://img.shields.io/crates/l/actix-web.svg) -[![Dependency Status](https://deps.rs/crate/actix-web/4.4.0/status.svg)](https://deps.rs/crate/actix-web/4.4.0) +[![Dependency Status](https://deps.rs/crate/actix-web/4.4.1/status.svg)](https://deps.rs/crate/actix-web/4.4.1)
[![CI](https://github.com/actix/actix-web/actions/workflows/ci.yml/badge.svg)](https://github.com/actix/actix-web/actions/workflows/ci.yml) [![codecov](https://codecov.io/gh/actix/actix-web/branch/master/graph/badge.svg)](https://codecov.io/gh/actix/actix-web) diff --git a/awc/CHANGES.md b/awc/CHANGES.md index 3a1996cba..6f4212f90 100644 --- a/awc/CHANGES.md +++ b/awc/CHANGES.md @@ -2,6 +2,8 @@ ## Unreleased +## 3.3.0 + - Update `trust-dns-resolver` dependency to `0.23`. - Updated `zstd` dependency to `0.13`. diff --git a/awc/Cargo.toml b/awc/Cargo.toml index 07811c979..14009fb4f 100644 --- a/awc/Cargo.toml +++ b/awc/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "awc" -version = "3.2.0" +version = "3.3.0" authors = ["Nikolay Kim "] 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"] } diff --git a/awc/README.md b/awc/README.md index 1f31167eb..035348fbd 100644 --- a/awc/README.md +++ b/awc/README.md @@ -3,9 +3,9 @@ > Async HTTP and WebSocket client library. [![crates.io](https://img.shields.io/crates/v/awc?label=latest)](https://crates.io/crates/awc) -[![Documentation](https://docs.rs/awc/badge.svg?version=3.2.0)](https://docs.rs/awc/3.2.0) +[![Documentation](https://docs.rs/awc/badge.svg?version=3.3.0)](https://docs.rs/awc/3.3.0) ![MIT or Apache 2.0 licensed](https://img.shields.io/crates/l/awc) -[![Dependency Status](https://deps.rs/crate/awc/3.2.0/status.svg)](https://deps.rs/crate/awc/3.2.0) +[![Dependency Status](https://deps.rs/crate/awc/3.3.0/status.svg)](https://deps.rs/crate/awc/3.3.0) [![Chat on Discord](https://img.shields.io/discord/771444961383153695?label=chat&logo=discord)](https://discord.gg/NWpN5mmg3x) ## Documentation & Resources diff --git a/scripts/bump b/scripts/bump index 9d90542c6..68f923e75 100755 --- a/scripts/bump +++ b/scripts/bump @@ -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:"