From 63864ecf9e3e6b8dbf883d3030267a525fb50a18 Mon Sep 17 00:00:00 2001 From: Takeru Sato Date: Wed, 13 May 2020 01:48:35 +0900 Subject: [PATCH 1/2] support parsing of SameSite=None (#1503) --- actix-http/CHANGES.md | 6 ++++++ actix-http/src/cookie/parse.rs | 35 ++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/actix-http/CHANGES.md b/actix-http/CHANGES.md index 92302a666..56cd9e58c 100644 --- a/actix-http/CHANGES.md +++ b/actix-http/CHANGES.md @@ -1,5 +1,11 @@ # Changes +## [Unreleased] + +### Fixed + +* Support parsing of `SameSite=None` [#1503] + ## [2.0.0-alpha.3] - 2020-05-08 ### Fixed diff --git a/actix-http/src/cookie/parse.rs b/actix-http/src/cookie/parse.rs index ce261c758..d472b32b6 100644 --- a/actix-http/src/cookie/parse.rs +++ b/actix-http/src/cookie/parse.rs @@ -172,6 +172,8 @@ fn parse_inner<'c>(s: &str, decode: bool) -> Result, ParseError> { cookie.same_site = Some(SameSite::Strict); } else if v.eq_ignore_ascii_case("lax") { cookie.same_site = Some(SameSite::Lax); + } else if v.eq_ignore_ascii_case("none") { + cookie.same_site = Some(SameSite::None); } else { // We do nothing here, for now. When/if the `SameSite` // attribute becomes standard, the spec says that we should @@ -261,6 +263,16 @@ mod tests { assert_eq_parse!("foo=bar; SameSite=strict", expected); assert_eq_parse!("foo=bar; SameSite=STrICT", expected); assert_eq_parse!("foo=bar; SameSite=STRICT", expected); + + let expected = Cookie::build("foo", "bar") + .same_site(SameSite::None) + .finish(); + + assert_eq_parse!("foo=bar; SameSite=None", expected); + assert_eq_parse!("foo=bar; SameSITE=None", expected); + assert_eq_parse!("foo=bar; SameSite=nOne", expected); + assert_eq_parse!("foo=bar; SameSite=NoNE", expected); + assert_eq_parse!("foo=bar; SameSite=NONE", expected); } #[test] @@ -396,6 +408,29 @@ mod tests { Domain=foo.com; Expires=Wed, 21 Oct 2015 07:28:00 GMT", unexpected ); + + expected.set_expires(expires); + expected.set_same_site(SameSite::Lax); + assert_eq_parse!( + " foo=bar ;HttpOnly; Secure; Max-Age=4; Path=/foo; \ + Domain=foo.com; Expires=Wed, 21 Oct 2015 07:28:00 GMT; \ + SameSite=Lax", + expected + ); + expected.set_same_site(SameSite::Strict); + assert_eq_parse!( + " foo=bar ;HttpOnly; Secure; Max-Age=4; Path=/foo; \ + Domain=foo.com; Expires=Wed, 21 Oct 2015 07:28:00 GMT; \ + SameSite=Strict", + expected + ); + expected.set_same_site(SameSite::None); + assert_eq_parse!( + " foo=bar ;HttpOnly; Secure; Max-Age=4; Path=/foo; \ + Domain=foo.com; Expires=Wed, 21 Oct 2015 07:28:00 GMT; \ + SameSite=None", + expected + ); } #[test] From 996f1d7eaef70491bbda61fce69d96eed3ba6873 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Wed, 13 May 2020 01:57:37 +0100 Subject: [PATCH 2/2] bump msrv in ci and readme --- .github/workflows/linux.yml | 2 +- CHANGES.md | 1 + README.md | 3 ++- actix-files/CHANGES.md | 4 ++++ actix-files/README.md | 2 +- actix-framed/README.md | 2 +- actix-framed/changes.md | 4 ++++ actix-http/CHANGES.md | 4 ++++ actix-http/README.md | 2 +- actix-multipart/CHANGES.md | 4 ++++ actix-multipart/README.md | 2 +- actix-web-actors/CHANGES.md | 6 +++++- actix-web-actors/README.md | 2 +- actix-web-codegen/CHANGES.md | 4 ++++ actix-web-codegen/README.md | 7 +++++++ awc/CHANGES.md | 1 + awc/README.md | 2 +- src/lib.rs | 2 +- test-server/CHANGES.md | 1 + test-server/README.md | 2 +- 20 files changed, 46 insertions(+), 11 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index f94d5f811..ae804cc53 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -8,7 +8,7 @@ jobs: fail-fast: false matrix: version: - - 1.39.0 # MSRV + - 1.40.0 # MSRV - stable - nightly diff --git a/CHANGES.md b/CHANGES.md index 97b7ca63a..09b8f6a60 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,7 @@ ### Changed * Resources and Scopes can now access non-overridden data types set on App (or containing scopes) when setting their own data. [#1486] +* Bump minimum supported Rust version to 1.40 ## [3.0.0-alpha.2] - 2020-05-08 diff --git a/README.md b/README.md index 5dc8d376f..97e3ceeae 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ [![Join the chat at https://gitter.im/actix/actix](https://badges.gitter.im/actix/actix.svg)](https://gitter.im/actix/actix?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Documentation](https://docs.rs/actix-web/badge.svg)](https://docs.rs/actix-web) [![Download](https://img.shields.io/crates/d/actix-web.svg)](https://crates.io/crates/actix-web) -[![Version](https://img.shields.io/badge/rustc-1.39+-lightgray.svg)](https://blog.rust-lang.org/2019/11/07/Rust-1.39.0.html) +[![Version](https://img.shields.io/badge/rustc-1.40+-lightgray.svg)](https://blog.rust-lang.org/2019/12/19/Rust-1.40.0.html) ![License](https://img.shields.io/crates/l/actix-web.svg)

@@ -38,6 +38,7 @@ Actix web is a simple, pragmatic and extremely fast web framework for Rust. * Middlewares ([Logger, Session, CORS, etc](https://actix.rs/docs/middleware/)) * Includes an asynchronous [HTTP client](https://actix.rs/actix-web/actix_web/client/index.html) * Supports [Actix actor framework](https://github.com/actix/actix) +* Supports Rust 1.40+ ## Docs diff --git a/actix-files/CHANGES.md b/actix-files/CHANGES.md index c4918b56d..7901a392b 100644 --- a/actix-files/CHANGES.md +++ b/actix-files/CHANGES.md @@ -1,5 +1,9 @@ # Changes +## [Unreleased] - 2020-xx-xx + +* Bump minimum supported Rust version to 1.40 + ## [0.2.1] - 2019-12-22 * Use the same format for file URLs regardless of platforms diff --git a/actix-files/README.md b/actix-files/README.md index 9585e67a8..5a5a62083 100644 --- a/actix-files/README.md +++ b/actix-files/README.md @@ -6,4 +6,4 @@ * [API Documentation](https://docs.rs/actix-files/) * [Chat on gitter](https://gitter.im/actix/actix) * Cargo package: [actix-files](https://crates.io/crates/actix-files) -* Minimum supported Rust version: 1.33 or later +* Minimum supported Rust version: 1.40 or later diff --git a/actix-framed/README.md b/actix-framed/README.md index 1714b3640..3a5ea0596 100644 --- a/actix-framed/README.md +++ b/actix-framed/README.md @@ -5,4 +5,4 @@ * [API Documentation](https://docs.rs/actix-framed/) * [Chat on gitter](https://gitter.im/actix/actix) * Cargo package: [actix-framed](https://crates.io/crates/actix-framed) -* Minimum supported Rust version: 1.33 or later +* Minimum supported Rust version: 1.40 or later diff --git a/actix-framed/changes.md b/actix-framed/changes.md index 41c7aed0e..1c5d31fa2 100644 --- a/actix-framed/changes.md +++ b/actix-framed/changes.md @@ -1,5 +1,9 @@ # Changes +## [Unreleased] - 2020-xx-xx + +* Bump minimum supported Rust version to 1.40 + ## [0.3.0] - 2019-12-25 * Migrate to actix-http 1.0 diff --git a/actix-http/CHANGES.md b/actix-http/CHANGES.md index 56cd9e58c..e96b0451d 100644 --- a/actix-http/CHANGES.md +++ b/actix-http/CHANGES.md @@ -2,6 +2,10 @@ ## [Unreleased] +### Changed + +* Bump minimum supported Rust version to 1.40 + ### Fixed * Support parsing of `SameSite=None` [#1503] diff --git a/actix-http/README.md b/actix-http/README.md index 9acad3e6d..d4c96f2a7 100644 --- a/actix-http/README.md +++ b/actix-http/README.md @@ -8,7 +8,7 @@ Actix http * [API Documentation](https://docs.rs/actix-http/) * [Chat on gitter](https://gitter.im/actix/actix) * Cargo package: [actix-http](https://crates.io/crates/actix-http) -* Minimum supported Rust version: 1.31 or later +* Minimum supported Rust version: 1.40 or later ## Example diff --git a/actix-multipart/CHANGES.md b/actix-multipart/CHANGES.md index ed5c8ad3f..e7bea62c0 100644 --- a/actix-multipart/CHANGES.md +++ b/actix-multipart/CHANGES.md @@ -1,5 +1,9 @@ # Changes +## [Unreleased] - 2020-xx-xx + +* Bump minimum supported Rust version to 1.40 + ## [0.2.1] - 2020-01-xx * Remove the unused `time` dependency diff --git a/actix-multipart/README.md b/actix-multipart/README.md index a453f489e..edb2e0020 100644 --- a/actix-multipart/README.md +++ b/actix-multipart/README.md @@ -5,4 +5,4 @@ * [API Documentation](https://docs.rs/actix-multipart/) * [Chat on gitter](https://gitter.im/actix/actix) * Cargo package: [actix-multipart](https://crates.io/crates/actix-multipart) -* Minimum supported Rust version: 1.39 or later +* Minimum supported Rust version: 1.40 or later diff --git a/actix-web-actors/CHANGES.md b/actix-web-actors/CHANGES.md index 68947569a..8fd48f77c 100644 --- a/actix-web-actors/CHANGES.md +++ b/actix-web-actors/CHANGES.md @@ -1,6 +1,10 @@ # Changes -# [3.0.0-alpha.1] - 2020-05-08 +## [Unreleased] - 2020-xx-xx + +* Bump minimum supported Rust version to 1.40 + +## [3.0.0-alpha.1] - 2020-05-08 * Update the actix-web dependency to 3.0.0-alpha.1 * Update the actix dependency to 0.10.0-alpha.2 diff --git a/actix-web-actors/README.md b/actix-web-actors/README.md index 6ff7ac67c..fb8c3a621 100644 --- a/actix-web-actors/README.md +++ b/actix-web-actors/README.md @@ -5,4 +5,4 @@ Actix actors support for actix web framework [![Build Status](https://travis-ci. * [API Documentation](https://docs.rs/actix-web-actors/) * [Chat on gitter](https://gitter.im/actix/actix) * Cargo package: [actix-web-actors](https://crates.io/crates/actix-web-actors) -* Minimum supported Rust version: 1.33 or later +* Minimum supported Rust version: 1.40 or later diff --git a/actix-web-codegen/CHANGES.md b/actix-web-codegen/CHANGES.md index 941cd36de..da2faee38 100644 --- a/actix-web-codegen/CHANGES.md +++ b/actix-web-codegen/CHANGES.md @@ -1,5 +1,9 @@ # Changes +## [Unreleased] - 2020-xx-xx + +* Bump minimum supported Rust version to 1.40 + ## [0.2.1] - 2020-02-25 * Add `#[allow(missing_docs)]` attribute to generated structs [#1368] diff --git a/actix-web-codegen/README.md b/actix-web-codegen/README.md index c44a5fc7f..c482a6b36 100644 --- a/actix-web-codegen/README.md +++ b/actix-web-codegen/README.md @@ -1 +1,8 @@ # Macros for actix-web framework [![Build Status](https://travis-ci.org/actix/actix-web.svg?branch=master)](https://travis-ci.org/actix/actix-web) [![codecov](https://codecov.io/gh/actix/actix-web/branch/master/graph/badge.svg)](https://codecov.io/gh/actix/actix-web) [![crates.io](https://meritbadge.herokuapp.com/actix-web-codegen)](https://crates.io/crates/actix-web-codegen) [![Join the chat at https://gitter.im/actix/actix](https://badges.gitter.im/actix/actix.svg)](https://gitter.im/actix/actix?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + +## Documentation & Resources + +* [API Documentation](https://docs.rs/actix-web-codegen/) +* [Chat on gitter](https://gitter.im/actix/actix) +* Cargo package: [actix-web-codegen](https://crates.io/crates/actix-web-codegen) +* Minimum supported Rust version: 1.40 or later diff --git a/awc/CHANGES.md b/awc/CHANGES.md index d127700ac..67bbc38c5 100644 --- a/awc/CHANGES.md +++ b/awc/CHANGES.md @@ -5,6 +5,7 @@ ### Changed * Implement `std::error::Error` for our custom errors [#1422] +* Bump minimum supported Rust version to 1.40 [#1422]: https://github.com/actix/actix-web/pull/1422 diff --git a/awc/README.md b/awc/README.md index 3b0034d76..2b6309c1d 100644 --- a/awc/README.md +++ b/awc/README.md @@ -8,7 +8,7 @@ An HTTP Client * [API Documentation](https://docs.rs/awc/) * [Chat on gitter](https://gitter.im/actix/actix) * Cargo package: [awc](https://crates.io/crates/awc) -* Minimum supported Rust version: 1.33 or later +* Minimum supported Rust version: 1.40 or later ## Example diff --git a/src/lib.rs b/src/lib.rs index d7cb45074..cff4acf27 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -72,7 +72,7 @@ //! * SSL support with OpenSSL or `native-tls` //! * Middlewares (`Logger`, `Session`, `CORS`, `DefaultHeaders`) //! * Supports [Actix actor framework](https://github.com/actix/actix) -//! * Supported Rust version: 1.39 or later +//! * Supported Rust version: 1.40 or later //! //! ## Package feature //! diff --git a/test-server/CHANGES.md b/test-server/CHANGES.md index 35552030c..6a92d581c 100644 --- a/test-server/CHANGES.md +++ b/test-server/CHANGES.md @@ -5,6 +5,7 @@ * Update the `time` dependency to 0.2.7 * Update `actix-connect` dependency to 2.0.0-alpha.2 * Make `test_server` `async` fn. +* Bump minimum supported Rust version to 1.40 ## [1.0.0] - 2019-12-13 diff --git a/test-server/README.md b/test-server/README.md index e40650124..db0791db7 100644 --- a/test-server/README.md +++ b/test-server/README.md @@ -6,4 +6,4 @@ * [API Documentation](https://docs.rs/actix-http-test/) * [Chat on gitter](https://gitter.im/actix/actix) * Cargo package: [actix-http-test](https://crates.io/crates/actix-http-test) -* Minimum supported Rust version: 1.33 or later +* Minimum supported Rust version: 1.40 or later