diff --git a/.github/workflows/ci-post-merge.yml b/.github/workflows/ci-post-merge.yml
index 2de0ee349..af0e15531 100644
--- a/.github/workflows/ci-post-merge.yml
+++ b/.github/workflows/ci-post-merge.yml
@@ -42,7 +42,7 @@ jobs:
with:
command: generate-lockfile
- name: Cache Dependencies
- uses: Swatinem/rust-cache@v1.2.0
+ uses: Swatinem/rust-cache@v2.1.0
- name: check minimal
uses: actions-rs/cargo@v1
@@ -72,7 +72,11 @@ jobs:
matrix:
target:
- { name: macOS, os: macos-latest, triple: x86_64-apple-darwin }
- - { name: Windows, os: windows-latest, triple: x86_64-pc-windows-msvc }
+ - {
+ name: Windows,
+ os: windows-latest,
+ triple: x86_64-pc-windows-msvc,
+ }
version:
- nightly
@@ -83,44 +87,30 @@ jobs:
- uses: actions/checkout@v3
- name: Install ${{ matrix.version }}
- uses: actions-rs/toolchain@v1
- with:
- toolchain: ${{ matrix.version }}-${{ matrix.target.triple }}
- profile: minimal
- override: true
+ run: |
+ rustup install ${{ matrix.version }}-${{ matrix.target.triple }}
+ rustup override set ${{ matrix.version }}-${{ matrix.target.triple }}
- name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack
- name: Generate Cargo.lock
- uses: actions-rs/cargo@v1
- with:
- command: generate-lockfile
+ run: cargo generate-lockfile
- name: Cache Dependencies
- uses: Swatinem/rust-cache@v1.2.0
+ uses: Swatinem/rust-cache@v2.1.0
- name: check minimal
- uses: actions-rs/cargo@v1
- with: { command: ci-min }
+ run: cargo ci-min
- name: check minimal + examples
- uses: actions-rs/cargo@v1
- with: { command: ci-check-min-examples }
+ run: cargo ci-check-min-examples
- name: check default
- uses: actions-rs/cargo@v1
- with: { command: ci-check }
+ run: cargo ci-check
- name: tests
- uses: actions-rs/cargo@v1
timeout-minutes: 40
- with:
- command: ci-test
- args: >-
- --exclude=actix-redis
- --exclude=actix-session
- --exclude=actix-limitation
- -- --nocapture
+ run: cargo ci-test --exclude=actix-redis --exclude=actix-session --exclude=actix-limitation -- --nocapture
- name: Clear the cargo caches
run: |
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 2b6bda9f4..ed53e46a8 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -36,38 +36,30 @@ jobs:
- uses: actions/checkout@v3
- name: Install ${{ matrix.version }}
- uses: actions-rs/toolchain@v1
- with:
- toolchain: ${{ matrix.version }}-${{ matrix.target.triple }}
- profile: minimal
- override: true
+ run: |
+ rustup install ${{ matrix.version }}-${{ matrix.target.triple }}
+ rustup override set ${{ matrix.version }}-${{ matrix.target.triple }}
- name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack
- name: Generate Cargo.lock
- uses: actions-rs/cargo@v1
- with:
- command: generate-lockfile
+ run: cargo generate-lockfile
- name: Cache Dependencies
- uses: Swatinem/rust-cache@v1.2.0
+ uses: Swatinem/rust-cache@v2.1.0
- name: check minimal
- uses: actions-rs/cargo@v1
- with: { command: ci-min }
+ run: cargo ci-min
- name: check minimal + examples
- uses: actions-rs/cargo@v1
- with: { command: ci-check-min-examples }
+ run: cargo ci-check-min-examples
- name: check default
- uses: actions-rs/cargo@v1
- with: { command: ci-check }
+ run: cargo ci-check
- name: tests
- uses: actions-rs/cargo@v1
timeout-minutes: 40
- with: { command: ci-test }
+ run: cargo ci-test
- name: Clear the cargo caches
run: |
@@ -80,7 +72,11 @@ jobs:
matrix:
target:
- { name: macOS, os: macos-latest, triple: x86_64-apple-darwin }
- - { name: Windows, os: windows-latest, triple: x86_64-pc-windows-msvc }
+ - {
+ name: Windows,
+ os: windows-latest,
+ triple: x86_64-pc-windows-msvc,
+ }
version:
- 1.59 # MSRV
- stable
@@ -92,43 +88,30 @@ jobs:
- uses: actions/checkout@v3
- name: Install ${{ matrix.version }}
- uses: actions-rs/toolchain@v1
- with:
- toolchain: ${{ matrix.version }}-${{ matrix.target.triple }}
- profile: minimal
- override: true
+ run: |
+ rustup install ${{ matrix.version }}-${{ matrix.target.triple }}
+ rustup override set ${{ matrix.version }}-${{ matrix.target.triple }}
- name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack
- name: Generate Cargo.lock
- uses: actions-rs/cargo@v1
- with:
- command: generate-lockfile
+ run: cargo generate-lockfile
- name: Cache Dependencies
- uses: Swatinem/rust-cache@v1.2.0
+ uses: Swatinem/rust-cache@v2.1.0
- name: check minimal
- uses: actions-rs/cargo@v1
- with: { command: ci-min }
+ run: cargo ci-min
- name: check minimal + examples
- uses: actions-rs/cargo@v1
- with: { command: ci-check-min-examples }
+ run: cargo ci-check-min-examples
- name: check default
- uses: actions-rs/cargo@v1
- with: { command: ci-check }
+ run: cargo ci-check
- name: tests
- uses: actions-rs/cargo@v1
timeout-minutes: 40
- with:
- command: ci-test
- args: >-
- --exclude=actix-redis
- --exclude=actix-session
- --exclude=actix-limitation
+ run: cargo ci-test --exclude=actix-redis --exclude=actix-session --exclude=actix-limitation
- name: Clear the cargo caches
run: |
@@ -142,21 +125,15 @@ jobs:
- uses: actions/checkout@v3
- name: Install Rust (nightly)
- uses: actions-rs/toolchain@v1
- with:
- toolchain: nightly-x86_64-unknown-linux-gnu
- profile: minimal
- override: true
+ run: |
+ rustup install nightly
+ rustup override set nightly
- name: Generate Cargo.lock
- uses: actions-rs/cargo@v1
- with: { command: generate-lockfile }
+ run: cargo generate-lockfile
- name: Cache Dependencies
- uses: Swatinem/rust-cache@v1.3.0
+ uses: Swatinem/rust-cache@v2.1.0
- name: doc tests
- uses: actions-rs/cargo@v1
timeout-minutes: 40
- with:
- command: ci-doctest
- args: -- --nocapture
+ run: cargo ci-doctest -- --nocapture
diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml
index 2d8ec2d4c..86427041c 100644
--- a/.github/workflows/coverage.yml
+++ b/.github/workflows/coverage.yml
@@ -21,22 +21,19 @@ jobs:
- uses: actions/checkout@v3
- name: Install stable
- uses: actions-rs/toolchain@v1
- with:
- toolchain: stable-x86_64-unknown-linux-gnu
- profile: minimal
- override: true
+ run: |
+ rustup override set stable
+ rustup update stable
- name: Generate Cargo.lock
- uses: actions-rs/cargo@v1
- with: { command: generate-lockfile }
+ run: cargo generate-lockfile
- name: Cache Dependencies
- uses: Swatinem/rust-cache@v1.2.0
+ uses: Swatinem/rust-cache@v2.1.0
- name: Generate coverage file
run: |
cargo install cargo-tarpaulin --vers "^0.13"
cargo tarpaulin --workspace --out Xml --verbose
- name: Upload to Codecov
- uses: codecov/codecov-action@v1
+ uses: codecov/codecov-action@v3
with: { file: cobertura.xml }
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index ec65be585..0c2bd4ef5 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -11,15 +11,12 @@ jobs:
- uses: actions/checkout@v3
- name: Install Rust
- uses: actions-rs/toolchain@v1
- with:
- toolchain: nightly
- components: rustfmt
+ run: |
+ rustup override set nightly
+ rustup update nightly
+ rustup component add rustfmt
- name: Check with rustfmt
- uses: actions-rs/cargo@v1
- with:
- command: fmt
- args: --all -- --check
+ run: cargo fmt --all -- --check
clippy:
runs-on: ubuntu-latest
@@ -27,13 +24,9 @@ jobs:
- uses: actions/checkout@v3
- name: Install Rust
- uses: actions-rs/toolchain@v1
- with:
- toolchain: stable
- components: clippy
- override: true
+ run: |
+ rustup override set stable
+ rustup update stable
+ rustup component add rustfmt
- name: Check with Clippy
- uses: actions-rs/clippy-check@v1
- with:
- token: ${{ secrets.GITHUB_TOKEN }}
- args: --workspace --tests --all-features
+ run: cargo clippy --workspace --tests --all-features
diff --git a/.github/workflows/upload-doc.yml b/.github/workflows/upload-doc.yml
index bae24c567..2cae41484 100644
--- a/.github/workflows/upload-doc.yml
+++ b/.github/workflows/upload-doc.yml
@@ -12,17 +12,12 @@ jobs:
- uses: actions/checkout@v3
- name: Install Rust
- uses: actions-rs/toolchain@v1
- with:
- toolchain: nightly-x86_64-unknown-linux-gnu
- profile: minimal
- override: true
+ run: |
+ rustup override set nightly
+ rustup update nightly
- name: Build Docs
- uses: actions-rs/cargo@v1
- with:
- command: doc
- args: --workspace --all-features --no-deps
+ run: cargo doc --workspace --all-features --no-deps
- name: Tweak HTML
run: echo '' > target/doc/index.html
diff --git a/README.md b/README.md
index 6c48f6351..a4b34ee29 100644
--- a/README.md
+++ b/README.md
@@ -42,6 +42,7 @@ These crates are provided by the community.
| [tracing-actix-web] | [][tracing-actix-web] [](https://deps.rs/crate/tracing-actix-web/0.6.0) | A middleware to collect telemetry data from applications built on top of the actix-web framework. |
| [actix-ws] | [][actix-ws] [](https://deps.rs/crate/actix-ws/0.2.5) | Actor-less WebSockets for the Actix Runtime. |
| [actix-hash] | [][actix-hash] [](https://deps.rs/crate/actix-hash/0.4.0) | Hashing utilities for Actix Web. |
+| [actix-bincode] |  [](https://deps.rs/crate/actix-bincode/0.2.0) | Bincode payload extractor for Actix Web |
To add a crate to this list, submit a pull request.
@@ -72,3 +73,4 @@ To add a crate to this list, submit a pull request.
[tracing-actix-web]: https://crates.io/crates/tracing-actix-web
[actix-ws]: https://crates.io/crates/actix-ws
[actix-hash]: https://crates.io/crates/actix-hash
+[actix-bincode]: https://crates.io/crates/actix-bincode
diff --git a/actix-cors/CHANGES.md b/actix-cors/CHANGES.md
index 8ad8ae4f1..3e7896505 100644
--- a/actix-cors/CHANGES.md
+++ b/actix-cors/CHANGES.md
@@ -3,6 +3,12 @@
## Unreleased - 2022-xx-xx
+## 0.6.4 - 2022-10-28
+- Add `Cors::allow_private_network_access()` behind an unstable flag (`draft-private-network-access`). [#297]
+
+[#297]: https://github.com/actix/actix-extras/pull/297
+
+
## 0.6.3 - 2022-09-21
- Add `Cors::block_on_origin_mismatch()` option for controlling if requests are pre-emptively rejected. [#287]
- Minimum supported Rust version (MSRV) is now 1.59 due to transitive `time` dependency.
diff --git a/actix-cors/Cargo.toml b/actix-cors/Cargo.toml
index 7f1847eb5..48ab1671a 100644
--- a/actix-cors/Cargo.toml
+++ b/actix-cors/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "actix-cors"
-version = "0.6.3"
+version = "0.6.4"
authors = [
"Nikolay Kim ",
"Rob Ede ",
@@ -12,9 +12,12 @@ repository = "https://github.com/actix/actix-extras.git"
license = "MIT OR Apache-2.0"
edition = "2018"
-[lib]
-name = "actix_cors"
-path = "src/lib.rs"
+[package.metadata.docs.rs]
+rustdoc-args = ["--cfg", "docsrs"]
+all-features = true
+
+[features]
+draft-private-network-access = []
[dependencies]
actix-utils = "3"
diff --git a/actix-cors/README.md b/actix-cors/README.md
index 9489226e1..4c936a52b 100644
--- a/actix-cors/README.md
+++ b/actix-cors/README.md
@@ -3,9 +3,9 @@
> Cross-Origin Resource Sharing (CORS) controls for Actix Web.
[](https://crates.io/crates/actix-cors)
-[](https://docs.rs/actix-cors/0.6.3)
+[](https://docs.rs/actix-cors/0.6.4)

-[](https://deps.rs/crate/actix-cors/0.6.3)
+[](https://deps.rs/crate/actix-cors/0.6.4)
## Documentation & Resources
diff --git a/actix-cors/src/builder.rs b/actix-cors/src/builder.rs
index 4cf751e00..16d4a1578 100644
--- a/actix-cors/src/builder.rs
+++ b/actix-cors/src/builder.rs
@@ -101,6 +101,8 @@ impl Cors {
preflight: true,
send_wildcard: false,
supports_credentials: true,
+ #[cfg(feature = "draft-private-network-access")]
+ allow_private_network_access: false,
vary_header: true,
block_on_origin_mismatch: true,
};
@@ -370,7 +372,7 @@ impl Cors {
/// [Fetch Standard CORS protocol]: https://fetch.spec.whatwg.org/#http-cors-protocol
pub fn max_age(mut self, max_age: impl Into