From 7d2349afb93a676695decad2829e103a049247d9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Nov 2023 02:17:07 +0000 Subject: [PATCH 1/7] build(deps): bump taiki-e/install-action from 2.21.3 to 2.21.7 (#3183) Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.21.3 to 2.21.7. - [Release notes](https://github.com/taiki-e/install-action/releases) - [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/taiki-e/install-action/compare/v2.21.3...v2.21.7) --- updated-dependencies: - dependency-name: taiki-e/install-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci-post-merge.yml | 6 +++--- .github/workflows/ci.yml | 2 +- .github/workflows/coverage.yml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-post-merge.yml b/.github/workflows/ci-post-merge.yml index cb3ea77ca..b388444cf 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.21.3 + uses: taiki-e/install-action@v2.21.7 with: tool: cargo-hack @@ -85,7 +85,7 @@ jobs: uses: actions-rust-lang/setup-rust-toolchain@v1.5.0 - name: Install cargo-hack - uses: taiki-e/install-action@v2.21.3 + uses: taiki-e/install-action@v2.21.7 with: tool: cargo-hack @@ -106,7 +106,7 @@ jobs: uses: actions-rust-lang/setup-rust-toolchain@v1.5.0 - name: Install nextest - uses: taiki-e/install-action@v2.21.3 + uses: taiki-e/install-action@v2.21.7 with: tool: nextest diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ca9673da4..095333f78 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.21.3 + uses: taiki-e/install-action@v2.21.7 with: tool: cargo-hack diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 73931c238..ed2ef99ac 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.21.3 + uses: taiki-e/install-action@v2.21.7 with: tool: cargo-llvm-cov From 989548e36aca33c55e860f46302d1287e37ffa73 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Mon, 6 Nov 2023 23:54:38 +0000 Subject: [PATCH 2/7] chore: remove git from repo URLs --- actix-http-test/Cargo.toml | 2 +- actix-http/Cargo.toml | 2 +- actix-multipart-derive/Cargo.toml | 2 +- actix-multipart/Cargo.toml | 2 +- actix-router/Cargo.toml | 2 +- actix-test/Cargo.toml | 2 +- actix-web-codegen/Cargo.toml | 2 +- actix-web/Cargo.toml | 2 +- awc/Cargo.toml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/actix-http-test/Cargo.toml b/actix-http-test/Cargo.toml index 7f00ba30a..0881e0bc4 100644 --- a/actix-http-test/Cargo.toml +++ b/actix-http-test/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Nikolay Kim "] description = "Various helpers for Actix applications to use during testing" keywords = ["http", "web", "framework", "async", "futures"] homepage = "https://actix.rs" -repository = "https://github.com/actix/actix-web.git" +repository = "https://github.com/actix/actix-web" categories = [ "network-programming", "asynchronous", diff --git a/actix-http/Cargo.toml b/actix-http/Cargo.toml index 9e116c964..f483ea093 100644 --- a/actix-http/Cargo.toml +++ b/actix-http/Cargo.toml @@ -8,7 +8,7 @@ authors = [ description = "HTTP primitives for the Actix ecosystem" keywords = ["actix", "http", "framework", "async", "futures"] homepage = "https://actix.rs" -repository = "https://github.com/actix/actix-web.git" +repository = "https://github.com/actix/actix-web" categories = [ "network-programming", "asynchronous", diff --git a/actix-multipart-derive/Cargo.toml b/actix-multipart-derive/Cargo.toml index 75b4c723b..2f049a3fb 100644 --- a/actix-multipart-derive/Cargo.toml +++ b/actix-multipart-derive/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Jacob Halsey "] description = "Multipart form derive macro for Actix Web" keywords = ["http", "web", "framework", "async", "futures"] homepage = "https://actix.rs" -repository = "https://github.com/actix/actix-web.git" +repository = "https://github.com/actix/actix-web" license = "MIT OR Apache-2.0" edition = "2021" diff --git a/actix-multipart/Cargo.toml b/actix-multipart/Cargo.toml index 455d7db78..257d56132 100644 --- a/actix-multipart/Cargo.toml +++ b/actix-multipart/Cargo.toml @@ -8,7 +8,7 @@ authors = [ description = "Multipart form support for Actix Web" keywords = ["http", "web", "framework", "async", "futures"] homepage = "https://actix.rs" -repository = "https://github.com/actix/actix-web.git" +repository = "https://github.com/actix/actix-web" license = "MIT OR Apache-2.0" edition = "2021" diff --git a/actix-router/Cargo.toml b/actix-router/Cargo.toml index adf43a086..8a404dd20 100644 --- a/actix-router/Cargo.toml +++ b/actix-router/Cargo.toml @@ -8,7 +8,7 @@ authors = [ ] description = "Resource path matching and router" keywords = ["actix", "router", "routing"] -repository = "https://github.com/actix/actix-web.git" +repository = "https://github.com/actix/actix-web" license = "MIT OR Apache-2.0" edition = "2021" diff --git a/actix-test/Cargo.toml b/actix-test/Cargo.toml index 38b40ccfa..46d65abdc 100644 --- a/actix-test/Cargo.toml +++ b/actix-test/Cargo.toml @@ -8,7 +8,7 @@ authors = [ description = "Integration testing tools for Actix Web applications" keywords = ["http", "web", "framework", "async", "futures"] homepage = "https://actix.rs" -repository = "https://github.com/actix/actix-web.git" +repository = "https://github.com/actix/actix-web" categories = [ "network-programming", "asynchronous", diff --git a/actix-web-codegen/Cargo.toml b/actix-web-codegen/Cargo.toml index 748984b49..7039ea7df 100644 --- a/actix-web-codegen/Cargo.toml +++ b/actix-web-codegen/Cargo.toml @@ -3,7 +3,7 @@ name = "actix-web-codegen" version = "4.2.2" description = "Routing and runtime macros for Actix Web" homepage = "https://actix.rs" -repository = "https://github.com/actix/actix-web.git" +repository = "https://github.com/actix/actix-web" authors = [ "Nikolay Kim ", "Rob Ede ", diff --git a/actix-web/Cargo.toml b/actix-web/Cargo.toml index 994f6359f..c9aab17b2 100644 --- a/actix-web/Cargo.toml +++ b/actix-web/Cargo.toml @@ -14,7 +14,7 @@ categories = [ "web-programming::websocket" ] homepage = "https://actix.rs" -repository = "https://github.com/actix/actix-web.git" +repository = "https://github.com/actix/actix-web" license = "MIT OR Apache-2.0" edition.workspace = true rust-version.workspace = true diff --git a/awc/Cargo.toml b/awc/Cargo.toml index 90f68e4c4..07811c979 100644 --- a/awc/Cargo.toml +++ b/awc/Cargo.toml @@ -11,7 +11,7 @@ categories = [ "web-programming::websocket", ] homepage = "https://actix.rs" -repository = "https://github.com/actix/actix-web.git" +repository = "https://github.com/actix/actix-web" license = "MIT OR Apache-2.0" edition = "2021" From f5655721aa3f07a679072241c59415506cbc716d Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Fri, 10 Nov 2023 14:06:35 +0000 Subject: [PATCH 3/7] ci: rename lint workflow --- .github/workflows/{clippy-fmt.yml => lint.yml} | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) rename .github/workflows/{clippy-fmt.yml => lint.yml} (80%) diff --git a/.github/workflows/clippy-fmt.yml b/.github/workflows/lint.yml similarity index 80% rename from .github/workflows/clippy-fmt.yml rename to .github/workflows/lint.yml index 854944995..cbdd4acf0 100644 --- a/.github/workflows/clippy-fmt.yml +++ b/.github/workflows/lint.yml @@ -22,25 +22,31 @@ jobs: toolchain: nightly components: rustfmt - - run: cargo fmt --all -- --check + - name: Check with rustfmt + run: cargo fmt --all -- --check clippy: permissions: + contents: read checks: write # to add clippy checks to PR diffs runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions-rust-lang/setup-rust-toolchain@v1.5.0 + - name: Install Rust + uses: actions-rust-lang/setup-rust-toolchain@v1.5.0 with: components: clippy - - uses: giraffate/clippy-action@v1.0.1 + - name: Check with Clippy + uses: giraffate/clippy-action@v1.0.1 with: reporter: github-pr-check github_token: ${{ secrets.GITHUB_TOKEN }} - clippy_flags: --workspace --all-features --tests --examples --bins -- -Dclippy::todo -Aunknown_lints + clippy_flags: >- + --workspace --all-features --tests --examples --bins -- + -A unknown_lints -D clippy::todo -D clippy::dbg_macro lint-docs: runs-on: ubuntu-latest From e50bceb91493087d4059e605d94c13a11b09e747 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Nov 2023 02:00:08 +0000 Subject: [PATCH 4/7] build(deps): bump taiki-e/install-action from 2.21.7 to 2.21.11 (#3185) Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.21.7 to 2.21.11. - [Release notes](https://github.com/taiki-e/install-action/releases) - [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/taiki-e/install-action/compare/v2.21.7...v2.21.11) --- updated-dependencies: - dependency-name: taiki-e/install-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci-post-merge.yml | 6 +++--- .github/workflows/ci.yml | 2 +- .github/workflows/coverage.yml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-post-merge.yml b/.github/workflows/ci-post-merge.yml index b388444cf..51eddaa0c 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.21.7 + uses: taiki-e/install-action@v2.21.11 with: tool: cargo-hack @@ -85,7 +85,7 @@ jobs: uses: actions-rust-lang/setup-rust-toolchain@v1.5.0 - name: Install cargo-hack - uses: taiki-e/install-action@v2.21.7 + uses: taiki-e/install-action@v2.21.11 with: tool: cargo-hack @@ -106,7 +106,7 @@ jobs: uses: actions-rust-lang/setup-rust-toolchain@v1.5.0 - name: Install nextest - uses: taiki-e/install-action@v2.21.7 + uses: taiki-e/install-action@v2.21.11 with: tool: nextest diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 095333f78..cd10915aa 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.21.7 + uses: taiki-e/install-action@v2.21.11 with: tool: cargo-hack diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index ed2ef99ac..7d696b8af 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.21.7 + uses: taiki-e/install-action@v2.21.11 with: tool: cargo-llvm-cov From 9d1f75d349dd6ad8451b8d2dbc619561868dba4d Mon Sep 17 00:00:00 2001 From: Marcio Ordonez Date: Sun, 19 Nov 2023 08:22:55 -0300 Subject: [PATCH 5/7] fix: content type required flag (#3168) * fix: content type required flag * clarify comments for invalid json mime type * remove pr reference --------- Co-authored-by: Rob Ede --- actix-web/CHANGES.md | 4 ++++ actix-web/src/types/json.rs | 40 +++++++++++++++++++++++++++++-------- 2 files changed, 36 insertions(+), 8 deletions(-) diff --git a/actix-web/CHANGES.md b/actix-web/CHANGES.md index 50728a839..0079a4120 100644 --- a/actix-web/CHANGES.md +++ b/actix-web/CHANGES.md @@ -6,6 +6,10 @@ - Updated `zstd` dependency to `0.13`. +### Fixed + +- Fix validation of `Json` extractor when `JsonConfig::validate_content_type()` is set to false. + ## 4.4.0 ### Added diff --git a/actix-web/src/types/json.rs b/actix-web/src/types/json.rs index 59c95da4c..6b75c0cfe 100644 --- a/actix-web/src/types/json.rs +++ b/actix-web/src/types/json.rs @@ -328,14 +328,19 @@ impl JsonBody { ctype_required: bool, ) -> Self { // check content-type - let can_parse_json = if let Ok(Some(mime)) = req.mime_type() { - mime.subtype() == mime::JSON - || mime.suffix() == Some(mime::JSON) - || ctype_fn.map_or(false, |predicate| predicate(mime)) - } else { - // if `ctype_required` is false, assume payload is - // json even when content-type header is missing - !ctype_required + let can_parse_json = match (ctype_required, req.mime_type()) { + (true, Ok(Some(mime))) => { + mime.subtype() == mime::JSON + || mime.suffix() == Some(mime::JSON) + || ctype_fn.map_or(false, |predicate| predicate(mime)) + } + + // if content-type is expected but not parsable as mime type, bail + (true, _) => false, + + // if content-type validation is disabled, assume payload is JSON + // even when content-type header is missing or invalid mime type + (false, _) => true, }; if !can_parse_json { @@ -725,6 +730,25 @@ mod tests { assert!(s.is_ok()) } + #[actix_rt::test] + async fn test_json_ignoring_content_type() { + let (req, mut pl) = TestRequest::default() + .insert_header(( + header::CONTENT_LENGTH, + header::HeaderValue::from_static("16"), + )) + .insert_header(( + header::CONTENT_TYPE, + header::HeaderValue::from_static("invalid/value"), + )) + .set_payload(Bytes::from_static(b"{\"name\": \"test\"}")) + .app_data(JsonConfig::default().content_type_required(false)) + .to_http_parts(); + + let s = Json::::from_request(&req, &mut pl).await; + assert!(s.is_ok()); + } + #[actix_rt::test] async fn test_with_config_in_data_wrapper() { let (req, mut pl) = TestRequest::default() From c0615f28edba69cbd51f2eb60100c1de8fbbb9f7 Mon Sep 17 00:00:00 2001 From: Amit Upadhyay Date: Mon, 20 Nov 2023 00:24:08 +0530 Subject: [PATCH 6/7] Make compression middleware prefer brotli over zstd over gzip (#3189) * AcceptEncoding.preference() prefers brotli > zstd > gzip * AcceptEncoding.{ranked,negotiate}() prefers brotli > zstd > gzip * changelog entry * use browser-realistic encoding tests * fix choosing identity when q=0 --------- Co-authored-by: Rob Ede --- actix-web/CHANGES.md | 1 + actix-web/src/http/header/accept_encoding.rs | 50 +++++++++++++++++--- actix-web/tests/compression.rs | 32 ++++++++++--- 3 files changed, 69 insertions(+), 14 deletions(-) diff --git a/actix-web/CHANGES.md b/actix-web/CHANGES.md index 0079a4120..953befb7f 100644 --- a/actix-web/CHANGES.md +++ b/actix-web/CHANGES.md @@ -5,6 +5,7 @@ ### Changed - Updated `zstd` dependency to `0.13`. +- Compression middleware now prefers brotli over zstd over gzip. ### Fixed diff --git a/actix-web/src/http/header/accept_encoding.rs b/actix-web/src/http/header/accept_encoding.rs index cc80e7bb0..19d649926 100644 --- a/actix-web/src/http/header/accept_encoding.rs +++ b/actix-web/src/http/header/accept_encoding.rs @@ -149,7 +149,7 @@ impl AcceptEncoding { /// Extracts the most preferable encoding, accounting for [q-factor weighting]. /// - /// If no q-factors are provided, the first encoding is chosen. Note that items without + /// If no q-factors are provided, we prefer brotli > zstd > gzip. Note that items without /// q-factors are given the maximum preference value. /// /// As per the spec, returns [`Preference::Any`] if acceptable list is empty. Though, if this is @@ -167,6 +167,7 @@ impl AcceptEncoding { let mut max_item = None; let mut max_pref = Quality::ZERO; + let mut max_rank = 0; // uses manual max lookup loop since we want the first occurrence in the case of same // preference but `Iterator::max_by_key` would give us the last occurrence @@ -174,9 +175,13 @@ impl AcceptEncoding { for pref in &self.0 { // only change if strictly greater // equal items, even while unsorted, still have higher preference if they appear first - if pref.quality > max_pref { + + let rank = encoding_rank(pref); + + if (pref.quality, rank) > (max_pref, max_rank) { max_pref = pref.quality; max_item = Some(pref.item.clone()); + max_rank = rank; } } @@ -203,6 +208,8 @@ impl AcceptEncoding { /// Returns a sorted list of encodings from highest to lowest precedence, accounting /// for [q-factor weighting]. /// + /// If no q-factors are provided, we prefer brotli > zstd > gzip. + /// /// [q-factor weighting]: https://datatracker.ietf.org/doc/html/rfc7231#section-5.3.2 pub fn ranked(&self) -> Vec> { self.ranked_items().map(|q| q.item).collect() @@ -210,21 +217,44 @@ impl AcceptEncoding { fn ranked_items(&self) -> impl Iterator>> { if self.0.is_empty() { - return vec![].into_iter(); + return Vec::new().into_iter(); } let mut types = self.0.clone(); // use stable sort so items with equal q-factor retain listed order types.sort_by(|a, b| { - // sort by q-factor descending - b.quality.cmp(&a.quality) + // sort by q-factor descending then server ranking descending + + b.quality + .cmp(&a.quality) + .then(encoding_rank(b).cmp(&encoding_rank(a))) }); types.into_iter() } } +/// Returns server-defined encoding ranking. +fn encoding_rank(qv: &QualityItem>) -> u8 { + // ensure that q=0 items are never sorted above identity encoding + // invariant: sorting methods calling this fn use first-on-equal approach + if qv.quality == Quality::ZERO { + return 0; + } + + match qv.item { + Preference::Specific(Encoding::Known(ContentEncoding::Brotli)) => 5, + Preference::Specific(Encoding::Known(ContentEncoding::Zstd)) => 4, + Preference::Specific(Encoding::Known(ContentEncoding::Gzip)) => 3, + Preference::Specific(Encoding::Known(ContentEncoding::Deflate)) => 2, + Preference::Any => 0, + Preference::Specific(Encoding::Known(ContentEncoding::Identity)) => 0, + Preference::Specific(Encoding::Known(_)) => 1, + Preference::Specific(Encoding::Unknown(_)) => 1, + } +} + /// Returns true if "identity" is an acceptable encoding. /// /// Internal algorithm relies on item list being in descending order of quality. @@ -377,11 +407,11 @@ mod tests { ); assert_eq!( test.negotiate([Encoding::gzip(), Encoding::brotli(), Encoding::identity()].iter()), - Some(Encoding::gzip()) + Some(Encoding::brotli()) ); assert_eq!( test.negotiate([Encoding::brotli(), Encoding::gzip(), Encoding::identity()].iter()), - Some(Encoding::gzip()) + Some(Encoding::brotli()) ); } @@ -398,6 +428,9 @@ mod tests { let test = accept_encoding!("br", "gzip", "*"); assert_eq!(test.ranked(), vec![enc("br"), enc("gzip"), enc("*")]); + + let test = accept_encoding!("gzip", "br", "*"); + assert_eq!(test.ranked(), vec![enc("br"), enc("gzip"), enc("*")]); } #[test] @@ -420,5 +453,8 @@ mod tests { let test = accept_encoding!("br", "gzip", "*"); assert_eq!(test.preference().unwrap(), enc("br")); + + let test = accept_encoding!("gzip", "br", "*"); + assert_eq!(test.preference().unwrap(), enc("br")); } } diff --git a/actix-web/tests/compression.rs b/actix-web/tests/compression.rs index b911b9d1f..61ff1bff5 100644 --- a/actix-web/tests/compression.rs +++ b/actix-web/tests/compression.rs @@ -96,7 +96,7 @@ async fn negotiate_encoding_gzip() { let req = srv .post("/static") - .insert_header((header::ACCEPT_ENCODING, "gzip,br,zstd")) + .insert_header((header::ACCEPT_ENCODING, "gzip, br;q=0.8, zstd;q=0.5")) .send(); let mut res = req.await.unwrap(); @@ -109,7 +109,7 @@ async fn negotiate_encoding_gzip() { let mut res = srv .post("/static") .no_decompress() - .insert_header((header::ACCEPT_ENCODING, "gzip,br,zstd")) + .insert_header((header::ACCEPT_ENCODING, "gzip, br;q=0.8, zstd;q=0.5")) .send() .await .unwrap(); @@ -123,9 +123,11 @@ async fn negotiate_encoding_gzip() { async fn negotiate_encoding_br() { let srv = test_server!(); + // check that brotli content-encoding header is returned + let req = srv .post("/static") - .insert_header((header::ACCEPT_ENCODING, "br,zstd,gzip")) + .insert_header((header::ACCEPT_ENCODING, "br, zstd, gzip")) .send(); let mut res = req.await.unwrap(); @@ -135,10 +137,26 @@ async fn negotiate_encoding_br() { let bytes = res.body().await.unwrap(); assert_eq!(bytes, Bytes::from_static(LOREM)); + // check that brotli is preferred even when later in (q-less) list + + let req = srv + .post("/static") + .insert_header((header::ACCEPT_ENCODING, "gzip, zstd, br")) + .send(); + + let mut res = req.await.unwrap(); + assert_eq!(res.status(), StatusCode::OK); + assert_eq!(res.headers().get(header::CONTENT_ENCODING).unwrap(), "br"); + + let bytes = res.body().await.unwrap(); + assert_eq!(bytes, Bytes::from_static(LOREM)); + + // check that returned content is actually brotli encoded + let mut res = srv .post("/static") .no_decompress() - .insert_header((header::ACCEPT_ENCODING, "br,zstd,gzip")) + .insert_header((header::ACCEPT_ENCODING, "br, zstd, gzip")) .send() .await .unwrap(); @@ -154,7 +172,7 @@ async fn negotiate_encoding_zstd() { let req = srv .post("/static") - .insert_header((header::ACCEPT_ENCODING, "zstd,gzip,br")) + .insert_header((header::ACCEPT_ENCODING, "zstd, gzip, br;q=0.8")) .send(); let mut res = req.await.unwrap(); @@ -167,7 +185,7 @@ async fn negotiate_encoding_zstd() { let mut res = srv .post("/static") .no_decompress() - .insert_header((header::ACCEPT_ENCODING, "zstd,gzip,br")) + .insert_header((header::ACCEPT_ENCODING, "zstd, gzip, br;q=0.8")) .send() .await .unwrap(); @@ -207,7 +225,7 @@ async fn gzip_no_decompress() { // don't decompress response body .no_decompress() // signal that we want a compressed body - .insert_header((header::ACCEPT_ENCODING, "gzip,br,zstd")) + .insert_header((header::ACCEPT_ENCODING, "gzip, br;q=0.8, zstd;q=0.5")) .send(); let mut res = req.await.unwrap(); From 4accfab196fbf88e2f39da6306b7f8c7bc8dcc0b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Nov 2023 00:29:35 +0000 Subject: [PATCH 7/7] build(deps): bump taiki-e/install-action from 2.21.11 to 2.21.17 (#3195) Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.21.11 to 2.21.17. - [Release notes](https://github.com/taiki-e/install-action/releases) - [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/taiki-e/install-action/compare/v2.21.11...v2.21.17) --- updated-dependencies: - dependency-name: taiki-e/install-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci-post-merge.yml | 6 +++--- .github/workflows/ci.yml | 2 +- .github/workflows/coverage.yml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-post-merge.yml b/.github/workflows/ci-post-merge.yml index 51eddaa0c..86a09e0cd 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.21.11 + uses: taiki-e/install-action@v2.21.17 with: tool: cargo-hack @@ -85,7 +85,7 @@ jobs: uses: actions-rust-lang/setup-rust-toolchain@v1.5.0 - name: Install cargo-hack - uses: taiki-e/install-action@v2.21.11 + uses: taiki-e/install-action@v2.21.17 with: tool: cargo-hack @@ -106,7 +106,7 @@ jobs: uses: actions-rust-lang/setup-rust-toolchain@v1.5.0 - name: Install nextest - uses: taiki-e/install-action@v2.21.11 + uses: taiki-e/install-action@v2.21.17 with: tool: nextest diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cd10915aa..bc8026f96 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.21.11 + uses: taiki-e/install-action@v2.21.17 with: tool: cargo-hack diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 7d696b8af..4e02735c7 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.21.11 + uses: taiki-e/install-action@v2.21.17 with: tool: cargo-llvm-cov