diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index fa06a137a..a26842245 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -3,34 +3,40 @@ name: Bug Report about: Create a bug report. --- -Your issue may already be reported! -Please search on the [Actix Web issue tracker](https://github.com/actix/actix-web/issues) before creating one. +Your issue may already be reported! Please search on the [Actix Web issue tracker](https://github.com/actix/actix-web/issues) before creating one. ## Expected Behavior + ## Current Behavior + ## Possible Solution + ## Steps to Reproduce (for bugs) + + 1. 2. 3. 4. ## Context + ## Your Environment + - Rust Version (I.e, output of `rustc -V`): diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index d617cf708..e0d17fb27 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -2,12 +2,14 @@ ## PR Type + + PR_TYPE - ## PR Checklist + @@ -17,11 +19,10 @@ PR_TYPE - [ ] Format code with the latest stable rustfmt. - [ ] (Team) Label with affected crates and semver status. - ## Overview + - diff --git a/.prettierrc.json b/.prettierrc.json deleted file mode 100644 index 677ba8ef2..000000000 --- a/.prettierrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "proseWrap": "never" -} diff --git a/.prettierrc.yaml b/.prettierrc.yaml new file mode 100644 index 000000000..7b5590248 --- /dev/null +++ b/.prettierrc.yaml @@ -0,0 +1 @@ +proseWrap: never diff --git a/actix-files/CHANGES.md b/actix-files/CHANGES.md index 60d3ceb96..b4b2fd8c1 100644 --- a/actix-files/CHANGES.md +++ b/actix-files/CHANGES.md @@ -2,8 +2,8 @@ ## Unreleased - 2022-xx-xx - ## 0.6.3 - 2023-01-21 + - XHTML files now use `Content-Disposition: inline` instead of `attachment`. [#2903] - Minimum supported Rust version (MSRV) is now 1.59 due to transitive `time` dependency. - Update `tokio-uring` dependency to `0.4`. @@ -11,13 +11,14 @@ [#2903]: https://github.com/actix/actix-web/pull/2903 ## 0.6.2 - 2022-07-23 + - Allow partial range responses for video content to start streaming sooner. [#2817] - Minimum supported Rust version (MSRV) is now 1.57 due to transitive `time` dependency. [#2817]: https://github.com/actix/actix-web/pull/2817 - ## 0.6.1 - 2022-06-11 + - Add `NamedFile::{modified, metadata, content_type, content_disposition, encoding}()` getters. [#2021] - Update `tokio-uring` dependency to `0.3`. - Audio files now use `Content-Disposition: inline` instead of `attachment`. [#2645] @@ -26,46 +27,46 @@ [#2021]: https://github.com/actix/actix-web/pull/2021 [#2645]: https://github.com/actix/actix-web/pull/2645 - ## 0.6.0 - 2022-02-25 + - No significant changes since `0.6.0-beta.16`. - ## 0.6.0-beta.16 - 2022-01-31 + - No significant changes since `0.6.0-beta.15`. - ## 0.6.0-beta.15 - 2022-01-21 + - No significant changes since `0.6.0-beta.14`. - ## 0.6.0-beta.14 - 2022-01-14 + - The `prefer_utf8` option introduced in `0.4.0` is now true by default. [#2583] [#2583]: https://github.com/actix/actix-web/pull/2583 - ## 0.6.0-beta.13 - 2022-01-04 + - The `Files` service now rejects requests with URL paths that include `%2F` (decoded: `/`). [#2398] - The `Files` service now correctly decodes `%25` in the URL path to `%` for the file path. [#2398] - Minimum supported Rust version (MSRV) is now 1.54. [#2398]: https://github.com/actix/actix-web/pull/2398 - ## 0.6.0-beta.12 - 2021-12-29 + - No significant changes since `0.6.0-beta.11`. - ## 0.6.0-beta.11 - 2021-12-27 + - No significant changes since `0.6.0-beta.10`. - ## 0.6.0-beta.10 - 2021-12-11 + - No significant changes since `0.6.0-beta.9`. - ## 0.6.0-beta.9 - 2021-11-22 + - Add crate feature `experimental-io-uring`, enabling async file I/O to be utilized. This feature is only available on Linux OSes with recent kernel versions. This feature is semver-exempt. [#2408] - Add `NamedFile::open_async`. [#2408] - Fix 304 Not Modified responses to omit the Content-Length header, as per the spec. [#2453] @@ -76,24 +77,24 @@ [#2408]: https://github.com/actix/actix-web/pull/2408 [#2453]: https://github.com/actix/actix-web/pull/2453 - ## 0.6.0-beta.8 - 2021-10-20 + - Minimum supported Rust version (MSRV) is now 1.52. - ## 0.6.0-beta.7 - 2021-09-09 + - Minimum supported Rust version (MSRV) is now 1.51. - ## 0.6.0-beta.6 - 2021-06-26 + - Added `Files::path_filter()`. [#2274] - `Files::show_files_listing()` can now be used with `Files::index_file()` to show files listing as a fallback when the index file is not found. [#2228] [#2274]: https://github.com/actix/actix-web/pull/2274 [#2228]: https://github.com/actix/actix-web/pull/2228 - ## 0.6.0-beta.5 - 2021-06-17 + - `NamedFile` now implements `ServiceFactory` and `HttpServiceFactory` making it much more useful in routing. For example, it can be used directly as a default service. [#2135] - For symbolic links, `Content-Disposition` header no longer shows the filename of the original file. [#2156] - `Files::redirect_to_slash_directory()` now works as expected when used with `Files::show_files_listing()`. [#2225] @@ -104,58 +105,58 @@ [#2225]: https://github.com/actix/actix-web/pull/2225 [#2257]: https://github.com/actix/actix-web/pull/2257 - ## 0.6.0-beta.4 - 2021-04-02 + - Add support for `.guard` in `Files` to selectively filter `Files` services. [#2046] [#2046]: https://github.com/actix/actix-web/pull/2046 - ## 0.6.0-beta.3 - 2021-03-09 + - No notable changes. - ## 0.6.0-beta.2 - 2021-02-10 + - Fix If-Modified-Since and If-Unmodified-Since to not compare using sub-second timestamps. [#1887] - Replace `v_htmlescape` with `askama_escape`. [#1953] [#1887]: https://github.com/actix/actix-web/pull/1887 [#1953]: https://github.com/actix/actix-web/pull/1953 - ## 0.6.0-beta.1 - 2021-01-07 + - `HttpRange::parse` now has its own error type. - Update `bytes` to `1.0`. [#1813] [#1813]: https://github.com/actix/actix-web/pull/1813 - ## 0.5.0 - 2020-12-26 + - Optionally support hidden files/directories. [#1811] [#1811]: https://github.com/actix/actix-web/pull/1811 - ## 0.4.1 - 2020-11-24 + - Clarify order of parameters in `Files::new` and improve docs. - ## 0.4.0 - 2020-10-06 + - Add `Files::prefer_utf8` option that adds UTF-8 charset on certain response types. [#1714] [#1714]: https://github.com/actix/actix-web/pull/1714 - ## 0.3.0 - 2020-09-11 + - No significant changes from 0.3.0-beta.1. - ## 0.3.0-beta.1 - 2020-07-15 + - Update `v_htmlescape` to 0.10 - Update `actix-web` and `actix-http` dependencies to beta.1 - ## 0.3.0-alpha.1 - 2020-05-23 + - Update `actix-web` and `actix-http` dependencies to alpha - Fix some typos in the docs - Bump minimum supported Rust version to 1.40 @@ -163,73 +164,73 @@ [#1384]: https://github.com/actix/actix-web/pull/1384 - ## 0.2.1 - 2019-12-22 + - Use the same format for file URLs regardless of platforms - ## 0.2.0 - 2019-12-20 + - Fix BodyEncoding trait import #1220 - ## 0.2.0-alpha.1 - 2019-12-07 + - Migrate to `std::future` - ## 0.1.7 - 2019-11-06 -- Add an additional `filename*` param in the `Content-Disposition` header of - `actix_files::NamedFile` to be more compatible. (#1151) + +- Add an additional `filename*` param in the `Content-Disposition` header of `actix_files::NamedFile` to be more compatible. (#1151) ## 0.1.6 - 2019-10-14 + - Add option to redirect to a slash-ended path `Files` #1132 - ## 0.1.5 - 2019-10-08 + - Bump up `mime_guess` crate version to 2.0.1 - Bump up `percent-encoding` crate version to 2.1 - Allow user defined request guards for `Files` #1113 - ## 0.1.4 - 2019-07-20 + - Allow to disable `Content-Disposition` header #686 - ## 0.1.3 - 2019-06-28 + - Do not set `Content-Length` header, let actix-http set it #930 - ## 0.1.2 - 2019-06-13 + - Content-Length is 0 for NamedFile HEAD request #914 - Fix ring dependency from actix-web default features for #741 - ## 0.1.1 - 2019-06-01 + - Static files are incorrectly served as both chunked and with length #812 - ## 0.1.0 - 2019-05-25 + - NamedFile last-modified check always fails due to nano-seconds in file modified date #820 - ## 0.1.0-beta.4 - 2019-05-12 + - Update actix-web to beta.4 - ## 0.1.0-beta.1 - 2019-04-20 + - Update actix-web to beta.1 - ## 0.1.0-alpha.6 - 2019-04-14 + - Update actix-web to alpha6 - ## 0.1.0-alpha.4 - 2019-04-08 + - Update actix-web to alpha4 - ## 0.1.0-alpha.2 - 2019-04-02 + - Add default handler support - ## 0.1.0-alpha.1 - 2019-03-28 + - Initial impl diff --git a/actix-files/README.md b/actix-files/README.md index 9a7e6e722..8869ca436 100644 --- a/actix-files/README.md +++ b/actix-files/README.md @@ -15,4 +15,4 @@ - [API Documentation](https://docs.rs/actix-files) - [Example Project](https://github.com/actix/examples/tree/master/basics/static-files) -- Minimum Supported Rust Version (MSRV): 1.54 +- Minimum Supported Rust Version (MSRV): 1.59 diff --git a/actix-http-test/CHANGES.md b/actix-http-test/CHANGES.md index 0eeb80454..e56883c19 100644 --- a/actix-http-test/CHANGES.md +++ b/actix-http-test/CHANGES.md @@ -2,12 +2,12 @@ ## Unreleased - 2022-xx-xx - ## 3.1.0 - 2023-01-21 + - Minimum supported Rust version (MSRV) is now 1.59. - ## 3.0.0 - 2022-07-24 + - `TestServer::stop` is now async and will wait for the server and system to shutdown. [#2442] - Added `TestServer::client_headers` method. [#2097] - Update `actix-server` dependency to `2`. @@ -19,71 +19,71 @@ [#2097]: https://github.com/actix/actix-web/pull/2097 [#1813]: https://github.com/actix/actix-web/pull/1813 -
3.0.0 Pre-Releases ## 3.0.0-beta.13 - 2022-02-16 + - No significant changes since `3.0.0-beta.12`. - ## 3.0.0-beta.12 - 2022-01-31 + - No significant changes since `3.0.0-beta.11`. - ## 3.0.0-beta.11 - 2022-01-04 + - Minimum supported Rust version (MSRV) is now 1.54. - ## 3.0.0-beta.10 - 2021-12-27 + - Update `actix-server` to `2.0.0-rc.2`. [#2550] [#2550]: https://github.com/actix/actix-web/pull/2550 - ## 3.0.0-beta.9 - 2021-12-11 + - No significant changes since `3.0.0-beta.8`. - ## 3.0.0-beta.8 - 2021-11-30 + - Update `actix-tls` to `3.0.0-rc.1`. [#2474] [#2474]: https://github.com/actix/actix-web/pull/2474 - ## 3.0.0-beta.7 - 2021-11-22 + - Fix compatibility with experimental `io-uring` feature of `actix-rt`. [#2408] [#2408]: https://github.com/actix/actix-web/pull/2408 - ## 3.0.0-beta.6 - 2021-11-15 + - `TestServer::stop` is now async and will wait for the server and system to shutdown. [#2442] - Update `actix-server` to `2.0.0-beta.9`. [#2442] - Minimum supported Rust version (MSRV) is now 1.52. [#2442]: https://github.com/actix/actix-web/pull/2442 - ## 3.0.0-beta.5 - 2021-09-09 + - Minimum supported Rust version (MSRV) is now 1.51. - ## 3.0.0-beta.4 - 2021-04-02 + - Added `TestServer::client_headers` method. [#2097] [#2097]: https://github.com/actix/actix-web/pull/2097 - ## 3.0.0-beta.3 - 2021-03-09 -- No notable changes. +- No notable changes. ## 3.0.0-beta.2 - 2021-02-10 + - No notable changes. - ## 3.0.0-beta.1 - 2021-01-07 + - Update `bytes` to `1.0`. [#1813] [#1813]: https://github.com/actix/actix-web/pull/1813 @@ -91,6 +91,7 @@
## 2.1.0 - 2020-11-25 + - Add ability to set address for `TestServer`. [#1645] - Upgrade `base64` to `0.13`. - Upgrade `serde_urlencoded` to `0.7`. [#1773] @@ -98,12 +99,12 @@ [#1773]: https://github.com/actix/actix-web/pull/1773 [#1645]: https://github.com/actix/actix-web/pull/1645 - ## 2.0.0 - 2020-09-11 + - Update actix-codec and actix-utils dependencies. - ## 2.0.0-alpha.1 - 2020-05-23 + - Update the `time` dependency to 0.2.7 - Update `actix-connect` dependency to 2.0.0-alpha.2 - Make `test_server` `async` fn. @@ -113,55 +114,56 @@ - Update `env_logger` dependency to 0.7 ## 1.0.0 - 2019-12-13 + - Replaced `TestServer::start()` with `test_server()` - ## 1.0.0-alpha.3 - 2019-12-07 + - Migrate to `std::future` - ## 0.2.5 - 2019-09-17 + - Update serde_urlencoded to "0.6.1" - Increase TestServerRuntime timeouts from 500ms to 3000ms - Do not override current `System` - ## 0.2.4 - 2019-07-18 + - Update actix-server to 0.6 - ## 0.2.3 - 2019-07-16 + - Add `delete`, `options`, `patch` methods to `TestServerRunner` - ## 0.2.2 - 2019-06-16 + - Add .put() and .sput() methods - ## 0.2.1 - 2019-06-05 + - Add license files - ## 0.2.0 - 2019-05-12 + - Update awc and actix-http deps - ## 0.1.1 - 2019-04-24 + - Always make new connection for http client - ## 0.1.0 - 2019-04-16 + - No changes - ## 0.1.0-alpha.3 - 2019-04-02 + - Request functions accept path #743 - ## 0.1.0-alpha.2 - 2019-03-29 + - Added TestServerRuntime::load_body() method - Update actix-http and awc libraries - ## 0.1.0-alpha.1 - 2019-03-28 + - Initial impl diff --git a/actix-http-test/README.md b/actix-http-test/README.md index 910b5649d..94f0e88a5 100644 --- a/actix-http-test/README.md +++ b/actix-http-test/README.md @@ -14,4 +14,4 @@ ## Documentation & Resources - [API Documentation](https://docs.rs/actix-http-test) -- Minimum Supported Rust Version (MSRV): 1.54 +- Minimum Supported Rust Version (MSRV): 1.59 diff --git a/actix-http/CHANGES.md b/actix-http/CHANGES.md index 6a45e79dd..033cd994c 100644 --- a/actix-http/CHANGES.md +++ b/actix-http/CHANGES.md @@ -2,9 +2,10 @@ ## Unreleased - 2022-xx-xx - ## 3.3.0 - 2023-01-21 + ### Added + - Implement `MessageBody` for `Cow<'static, str>` and `Cow<'static, [u8]>`. [#2959] - Implement `MessageBody` for `&mut B` where `B: MessageBody + Unpin`. [#2868] - Implement `MessageBody` for `Pin` where `B::Target: MessageBody`. [#2868] @@ -21,9 +22,11 @@ - `X_FORWARDED_PROTO` ### Fixed + - Fix non-empty body of HTTP/2 HEAD responses. [#2920] ### Performance + - Improve overall performance of operations on `Extensions`. [#2890] [#2959]: https://github.com/actix/actix-web/pull/2959 @@ -35,74 +38,86 @@ [#2956]: https://github.com/actix/actix-web/pull/2956 [#2968]: https://github.com/actix/actix-web/pull/2968 - ## 3.2.2 - 2022-09-11 + ### Changed + - Minimum supported Rust version (MSRV) is now 1.59 due to transitive `time` dependency. ### Fixed + - Avoid possibility of dispatcher getting stuck while back-pressuring I/O. [#2369] [#2369]: https://github.com/actix/actix-web/pull/2369 - ## 3.2.1 - 2022-07-02 + ### Fixed + - Fix parsing ambiguity in Transfer-Encoding and Content-Length headers for HTTP/1.0 requests. [#2794] [#2794]: https://github.com/actix/actix-web/pull/2794 - ## 3.2.0 - 2022-06-30 + ### Changed + - Minimum supported Rust version (MSRV) is now 1.57 due to transitive `time` dependency. ### Fixed + - Websocket parser no longer throws endless overflow errors after receiving an oversized frame. [#2790] - Retain previously set Vary headers when using compression encoder. [#2798] [#2790]: https://github.com/actix/actix-web/pull/2790 [#2798]: https://github.com/actix/actix-web/pull/2798 - ## 3.1.0 - 2022-06-11 + ### Changed + - Minimum supported Rust version (MSRV) is now 1.56 due to transitive `hashbrown` dependency. ### Fixed + - Revert broken fix in [#2624] that caused erroneous 500 error responses. Temporarily re-introduces [#2357] bug. [#2779] [#2624]: https://github.com/actix/actix-web/pull/2624 [#2357]: https://github.com/actix/actix-web/issues/2357 [#2779]: https://github.com/actix/actix-web/pull/2779 - ## 3.0.4 - 2022-03-09 + ### Fixed + - Document on docs.rs with `ws` feature enabled. - ## 3.0.3 - 2022-03-08 + ### Fixed + - Allow spaces between header name and colon when parsing responses. [#2684] [#2684]: https://github.com/actix/actix-web/pull/2684 - ## 3.0.2 - 2022-03-05 + ### Fixed + - Fix encoding camel-case header names with more than one hyphen. [#2683] [#2683]: https://github.com/actix/actix-web/pull/2683 - ## 3.0.1 - 2022-03-04 + - Fix panic in H1 dispatcher when pipelining is used with keep-alive. [#2678] [#2678]: https://github.com/actix/actix-web/issues/2678 ## 3.0.0 - 2022-02-25 + ### Dependencies + - Updated `actix-*` to Tokio v1-based versions. [#1813] - Updated `bytes` to `1.0`. [#1813] - Updated `h2` to `0.3`. [#1813] @@ -111,6 +126,7 @@ - Updated `tokio` to `1`. ### Added + - Crate Features: - `ws`; disabled by default. [#2618] - `http2`; disabled by default. [#2618] @@ -179,6 +195,7 @@ - `#[must_use]` for `ws::Codec` to prevent subtle bugs. [#1920] ### Changed + - Traits: - Rename `IntoHeaderValue => TryIntoHeaderValue`. [#2510] - `MessageBody` now has an associated `Error` type. [#2183] @@ -234,6 +251,7 @@ - Minimum supported Rust version (MSRV) is now 1.54. ### Fixed + - A `Vary` header is now correctly sent along with compressed content. [#2501] - HTTP/1.1 dispatcher correctly uses client request timeout. [#2611] - Fixed issue where handlers that took payload but then dropped without reading it to EOF it would cause keep-alive connections to become stuck. [#2624] @@ -246,6 +264,7 @@ - Fixed quality parse error in Accept-Encoding header. [#2344] ### Removed + - Crate Features: - `compress` feature. [#2065] - `cookies` feature. [#2065] @@ -308,7 +327,6 @@ - `downcast` and `downcast_get_type_id` macros. [#2291] - Down-casting for `MessageBody` types; use standard `Any` trait. [#2183] - [#1813]: https://github.com/actix/actix-web/pull/1813 [#1845]: https://github.com/actix/actix-web/pull/1845 [#1857]: https://github.com/actix/actix-web/pull/1857 @@ -381,37 +399,42 @@ [#2660]: https://github.com/actix/actix-web/pull/2660 [00ba8d55]: https://github.com/actix/actix-web/commit/00ba8d55492284581695d824648590715a8bd386 -
3.0.0 Pre-Releases ## 3.0.0-rc.4 - 2022-02-22 + ### Fixed + - Fix h1 dispatcher panic. [1ce58ecb] [1ce58ecb]: https://github.com/actix/actix-web/commit/1ce58ecb305c60e51db06e6c913b7a1344e229ca - ## 3.0.0-rc.3 - 2022-02-16 + - No significant changes since `3.0.0-rc.2`. - ## 3.0.0-rc.2 - 2022-02-08 + ### Added + - Implement `From>` for `Response>`. [#2625] ### Changed + - `error::DispatcherError` enum is now marked `#[non_exhaustive]`. [#2624] ### Fixed + - Issue where handlers that took payload but then dropped without reading it to EOF it would cause keep-alive connections to become stuck. [#2624] [#2624]: https://github.com/actix/actix-web/pull/2624 [#2625]: https://github.com/actix/actix-web/pull/2625 - ## 3.0.0-rc.1 - 2022-01-31 + ### Added + - Implement `Default` for `KeepAlive`. [#2611] - Implement `From` for `KeepAlive`. [#2611] - Implement `From>` for `KeepAlive`. [#2611] @@ -420,6 +443,7 @@ - Crate `http2` feature flag, disabled by default. [#2618] ### Changed + - Rename `ServiceConfig::{client_timer_expire => client_request_deadline}`. [#2611] - Rename `ServiceConfig::{client_disconnect_timer => client_disconnect_deadline}`. [#2611] - Deadline methods in `ServiceConfig` now return `std::time::Instant`s instead of Tokio's wrapper type. [#2611] @@ -430,9 +454,11 @@ - `ServiceConfig::keep_alive` now returns a `KeepAlive`. [#2611] ### Fixed + - HTTP/1.1 dispatcher correctly uses client request timeout. [#2611] ### Removed + - `ServiceConfig::{client_timer, keep_alive_timer}`. [#2611] - `impl From for KeepAlive`; use `Duration`s instead. [#2611] - `impl From> for KeepAlive`; use `Duration`s instead. [#2611] @@ -441,16 +467,19 @@ [#2611]: https://github.com/actix/actix-web/pull/2611 [#2618]: https://github.com/actix/actix-web/pull/2618 - ## 3.0.0-beta.19 - 2022-01-21 + ### Added + - Response headers can be sent as camel case using `res.head_mut().set_camel_case_headers(true)`. [#2587] - `ResponseHead` now implements `Clone`. [#2585] ### Changed + - Brotli (de)compression support is now provided by the `brotli` crate. [#2538] ### Removed + - `ResponseHead::extensions[_mut]()`. [#2585] - `ResponseBuilder::extensions[_mut]()`. [#2585] @@ -458,9 +487,10 @@ [#2585]: https://github.com/actix/actix-web/pull/2585 [#2587]: https://github.com/actix/actix-web/pull/2587 - ## 3.0.0-beta.18 - 2022-01-04 + ### Added + - `impl Eq` for `header::ContentEncoding`. [#2501] - `impl Copy` for `QualityItem` where `T: Copy`. [#2501] - `Quality::ZERO` equivalent to `q=0`. [#2501] @@ -468,6 +498,7 @@ - `ContentEncoding::to_header_value()`. [#2501] ### Changed + - `Quality::MIN` is now the smallest non-zero value. [#2501] - `QualityItem::min` semantics changed with `QualityItem::MIN`. [#2501] - Rename `ContentEncoding::{Br => Brotli}`. [#2501] @@ -475,19 +506,22 @@ - Minimum supported Rust version (MSRV) is now 1.54. ### Fixed + - `ContentEncoding::Identity` can now be parsed from a string. [#2501] - A `Vary` header is now correctly sent along with compressed content. [#2501] ### Removed + - `ContentEncoding::Auto` variant. [#2501] - `ContentEncoding::is_compression()`. [#2501] [#2501]: https://github.com/actix/actix-web/pull/2501 [#2565]: https://github.com/actix/actix-web/pull/2565 - ## 3.0.0-beta.17 - 2021-12-27 + ### Changed + - `HeaderMap::get_all` now returns a `std::slice::Iter`. [#2527] - `Payload` inner fields are now named. [#2545] - `impl Stream` for `Payload` no longer requires the `Stream` variant be `Unpin`. [#2545] @@ -496,30 +530,35 @@ - Rename `PayloadStream` to `BoxedPayloadStream`. [#2545] ### Removed + - `h1::Payload::readany`. [#2545] [#2527]: https://github.com/actix/actix-web/pull/2527 [#2545]: https://github.com/actix/actix-web/pull/2545 - ## 3.0.0-beta.16 - 2021-12-17 + ### Added + - New method on `MessageBody` trait, `try_into_bytes`, with default implementation, for optimizations on body types that complete in exactly one poll. Replaces `is_complete_body` and `take_complete_body`. [#2522] ### Changed + - Rename trait `IntoHeaderPair => TryIntoHeaderPair`. [#2510] - Rename `TryIntoHeaderPair::{try_into_header_pair => try_into_pair}`. [#2510] - Rename trait `IntoHeaderValue => TryIntoHeaderValue`. [#2510] ### Removed + - `MessageBody::{is_complete_body,take_complete_body}`. [#2522] [#2510]: https://github.com/actix/actix-web/pull/2510 [#2522]: https://github.com/actix/actix-web/pull/2522 - ## 3.0.0-beta.15 - 2021-12-11 + ### Added + - Add timeout for canceling HTTP/2 server side connection handshake. Default to 5 seconds. [#2483] - HTTP/2 handshake timeout can be configured with `ServiceConfig::client_timeout`. [#2483] - `Response::map_into_boxed_body`. [#2468] @@ -540,6 +579,7 @@ - New `boxed` method on `MessageBody` trait for wrapping body type. [#2520] ### Changed + - Rename `body::BoxBody::{from_body => new}`. [#2468] - Body type for `Responses` returned from `Response::{new, ok, etc...}` is now `BoxBody`. [#2468] - The `Error` associated type on `MessageBody` type now requires `impl Error` (or similar). [#2468] @@ -549,6 +589,7 @@ - `ResponseBuilder::finish()` now returns `Response>`. [#2468] ### Removed + - `ResponseBuilder::streaming`. [#2468] - `impl Future` for `ResponseBuilder`. [#2468] - Remove unnecessary `MessageBody` bound on types passed to `body::AnyBody::new`. [#2468] @@ -568,9 +609,10 @@ [#2497]: https://github.com/actix/actix-web/pull/2497 [#2520]: https://github.com/actix/actix-web/pull/2520 - ## 3.0.0-beta.14 - 2021-11-30 + ### Changed + - Guarantee ordering of `header::GetAll` iterator to be same as insertion order. [#2467] - Expose `header::map` module. [#2467] - Implement `ExactSizeIterator` and `FusedIterator` for all `HeaderMap` iterators. [#2470] @@ -580,15 +622,17 @@ [#2470]: https://github.com/actix/actix-web/pull/2470 [#2474]: https://github.com/actix/actix-web/pull/2474 - ## 3.0.0-beta.13 - 2021-11-22 + ### Added + - `body::AnyBody::empty` for quickly creating an empty body. [#2446] - `body::AnyBody::none` for quickly creating a "none" body. [#2456] - `impl Clone` for `body::AnyBody where S: Clone`. [#2448] - `body::AnyBody::into_boxed` for quickly converting to a type-erased, boxed body type. [#2448] ### Changed + - Rename `body::AnyBody::{Message => Body}`. [#2446] - Rename `body::AnyBody::{from_message => new_boxed}`. [#2448] - Rename `body::AnyBody::{from_slice => copy_from_slice}`. [#2448] @@ -597,6 +641,7 @@ - `Encoder::response` now returns `AnyBody>`. [#2448] ### Removed + - `body::AnyBody::Empty`; an empty body can now only be represented as a zero-length `Bytes` variant. [#2446] - `body::BodySize::Empty`; an empty body can now only be represented as a `Sized(0)` variant. [#2446] - `EncoderError::Boxed`; it is no longer required. [#2446] @@ -606,33 +651,38 @@ [#2448]: https://github.com/actix/actix-web/pull/2448 [#2456]: https://github.com/actix/actix-web/pull/2456 - ## 3.0.0-beta.12 - 2021-11-15 + ### Changed + - Update `actix-server` to `2.0.0-beta.9`. [#2442] ### Removed + - `client` module. [#2425] - `trust-dns` feature. [#2425] [#2425]: https://github.com/actix/actix-web/pull/2425 [#2442]: https://github.com/actix/actix-web/pull/2442 - ## 3.0.0-beta.11 - 2021-10-20 + ### Changed + - Updated rustls to v0.20. [#2414] - Minimum supported Rust version (MSRV) is now 1.52. [#2414]: https://github.com/actix/actix-web/pull/2414 - ## 3.0.0-beta.10 - 2021-09-09 + ### Changed + - `ContentEncoding` is now marked `#[non_exhaustive]`. [#2377] - Minimum supported Rust version (MSRV) is now 1.51. ### Fixed + - Remove slice creation pointing to potential uninitialized data on h1 encoder. [#2364] - Remove `Into` bound on `Encoder` body types. [#2375] - Fix quality parse error in Accept-Encoding header. [#2344] @@ -642,25 +692,29 @@ [#2344]: https://github.com/actix/actix-web/pull/2344 [#2377]: https://github.com/actix/actix-web/pull/2377 - ## 3.0.0-beta.9 - 2021-08-09 + ### Fixed + - Potential HTTP request smuggling vulnerabilities. [RUSTSEC-2021-0081](https://github.com/rustsec/advisory-db/pull/977) - ## 3.0.0-beta.8 - 2021-06-26 + ### Changed + - Change compression algorithm features flags. [#2250] ### Removed + - `downcast` and `downcast_get_type_id` macros. [#2291] [#2291]: https://github.com/actix/actix-web/pull/2291 [#2250]: https://github.com/actix/actix-web/pull/2250 - ## 3.0.0-beta.7 - 2021-06-17 + ### Added + - Alias `body::Body` as `body::AnyBody`. [#2215] - `BoxAnyBody`: a boxed message body with boxed errors. [#2183] - Re-export `http` crate's `Error` type as `error::HttpError`. [#2171] @@ -671,6 +725,7 @@ - Add zstd support for `ContentEncoding`. [#2244] ### Changed + - The `MessageBody` trait now has an associated `Error` type. [#2183] - All error trait bounds in server service builders have changed from `Into` to `Into>`. [#2253] - All error trait bounds in message body and stream impls changed from `Into` to `Into>`. [#2253] @@ -684,6 +739,7 @@ - `HttpServer::{listen_rustls(), bind_rustls()}` now honor the ALPN protocols in the configuration parameter. [#2226] ### Removed + - Stop re-exporting `http` crate's `HeaderMap` types in addition to ours. [#2171] - Down-casting for `MessageBody` types. [#2183] - `error::Result` alias. [#2201] @@ -702,21 +758,23 @@ [#2253]: https://github.com/actix/actix-web/pull/2253 [#2244]: https://github.com/actix/actix-web/pull/2244 - - ## 3.0.0-beta.6 - 2021-04-17 + ### Added + - `impl MessageBody for Pin>`. [#2152] - `Response::{ok, bad_request, not_found, internal_server_error}`. [#2159] - Helper `body::to_bytes` for async collecting message body into Bytes. [#2158] ### Changed + - The type parameter of `Response` no longer has a default. [#2152] - The `Message` variant of `body::Body` is now `Pin>`. [#2152] - `BodyStream` and `SizedStream` are no longer restricted to Unpin types. [#2152] - Error enum types are marked `#[non_exhaustive]`. [#2161] ### Removed + - `cookies` feature flag. [#2065] - Top-level `cookies` mod (re-export). [#2065] - `HttpMessage` trait loses the `cookies` and `cookie` methods. [#2065] @@ -735,17 +793,20 @@ [#2158]: https://github.com/actix/actix-web/pull/2158 [#2161]: https://github.com/actix/actix-web/pull/2161 - ## 3.0.0-beta.5 - 2021-04-02 + ### Added + - `client::Connector::handshake_timeout` method for customizing TLS connection handshake timeout. [#2081] - `client::ConnectorService` as `client::Connector::finish` method's return type [#2081] - `client::ConnectionIo` trait alias [#2081] ### Changed + - `client::Connector` type now only have one generic type for `actix_service::Service`. [#2063] ### Removed + - Common typed HTTP headers were moved to actix-web. [2094] - `ResponseError` impl for `actix_utils::timeout::TimeoutError`. [#2127] @@ -754,14 +815,16 @@ [#2094]: https://github.com/actix/actix-web/pull/2094 [#2127]: https://github.com/actix/actix-web/pull/2127 - ## 3.0.0-beta.4 - 2021-03-08 + ### Changed + - Feature `cookies` is now optional and disabled by default. [#1981] - `ws::hash_key` now returns array. [#2035] - `ResponseBuilder::json` now takes `impl Serialize`. [#2052] ### Removed + - Re-export of `futures_channel::oneshot::Canceled` is removed from `error` mod. [#1994] - `ResponseError` impl for `futures_channel::oneshot::Canceled` is removed. [#1994] @@ -770,13 +833,14 @@ [#2035]: https://github.com/actix/actix-web/pull/2035 [#2052]: https://github.com/actix/actix-web/pull/2052 - ## 3.0.0-beta.3 - 2021-02-10 + - No notable changes. - ## 3.0.0-beta.2 - 2021-02-10 + ### Added + - `TryIntoHeaderPair` trait that allows using typed and untyped headers in the same methods. [#1869] - `ResponseBuilder::insert_header` method which allows using typed headers. [#1869] - `ResponseBuilder::append_header` method which allows using typed headers. [#1869] @@ -788,22 +852,21 @@ - `trust-dns` optional feature to enable `trust-dns-resolver` as client dns resolver. [#1969] ### Changed -- `ResponseBuilder::content_type` now takes an `impl TryIntoHeaderValue` to support using typed - `mime` types. [#1894] -- Renamed `TryIntoHeaderValue::{try_into => try_into_value}` to avoid ambiguity with std - `TryInto` trait. [#1894] + +- `ResponseBuilder::content_type` now takes an `impl TryIntoHeaderValue` to support using typed `mime` types. [#1894] +- Renamed `TryIntoHeaderValue::{try_into => try_into_value}` to avoid ambiguity with std `TryInto` trait. [#1894] - `Extensions::insert` returns Option of replaced item. [#1904] - Remove `HttpResponseBuilder::json2()`. [#1903] - Enable `HttpResponseBuilder::json()` to receive data by value and reference. [#1903] - `client::error::ConnectError` Resolver variant contains `Box` type. [#1905] - `client::ConnectorConfig` default timeout changed to 5 seconds. [#1905] -- Simplify `BlockingError` type to a unit struct. It's now only triggered when blocking thread pool - is dead. [#1957] +- Simplify `BlockingError` type to a unit struct. It's now only triggered when blocking thread pool is dead. [#1957] - `HeaderMap::len` now returns number of values instead of number of keys. [#1964] - `HeaderMap::insert` now returns iterator of removed values. [#1964] - `HeaderMap::remove` now returns iterator of removed values. [#1964] ### Removed + - `ResponseBuilder::set`; use `ResponseBuilder::insert_header`. [#1869] - `ResponseBuilder::set_header`; use `ResponseBuilder::insert_header`. [#1869] - `ResponseBuilder::header`; use `ResponseBuilder::append_header`. [#1869] @@ -813,6 +876,7 @@ - `ResponseError` impl for `actix::MailboxError`. [#1969] ### Documentation + - Vastly improve docs and add examples for `HeaderMap`. [#1964] [#1869]: https://github.com/actix/actix-web/pull/1869 @@ -825,12 +889,14 @@ [#1964]: https://github.com/actix/actix-web/pull/1964 [#1969]: https://github.com/actix/actix-web/pull/1969 - ## 3.0.0-beta.1 - 2021-01-07 + ### Added + - Add `Http3` to `Protocol` enum for future compatibility and also mark `#[non_exhaustive]`. ### Changed + - Update `actix-*` dependencies to tokio `1.0` based versions. [#1813] - Bumped `rand` to `0.8`. - Update `bytes` to `1.0`. [#1813] @@ -838,16 +904,11 @@ - The `ws::Message::Text` enum variant now contains a `bytestring::ByteString`. [#1864] ### Removed -- Deprecated `on_connect` methods have been removed. Prefer the new - `on_connect_ext` technique. [#1857] -- Remove `ResponseError` impl for `actix::actors::resolver::ResolverError` - due to deprecate of resolver actor. [#1813] -- Remove `ConnectError::SslHandshakeError` and re-export of `HandshakeError`. - due to the removal of this type from `tokio-openssl` crate. openssl handshake - error would return as `ConnectError::SslError`. [#1813] -- Remove `actix-threadpool` dependency. Use `actix_rt::task::spawn_blocking`. - Due to this change `actix_threadpool::BlockingError` type is moved into - `actix_http::error` module. [#1878] + +- Deprecated `on_connect` methods have been removed. Prefer the new `on_connect_ext` technique. [#1857] +- Remove `ResponseError` impl for `actix::actors::resolver::ResolverError` due to deprecate of resolver actor. [#1813] +- Remove `ConnectError::SslHandshakeError` and re-export of `HandshakeError`. due to the removal of this type from `tokio-openssl` crate. openssl handshake error would return as `ConnectError::SslError`. [#1813] +- Remove `actix-threadpool` dependency. Use `actix_rt::task::spawn_blocking`. Due to this change `actix_threadpool::BlockingError` type is moved into `actix_http::error` module. [#1878] [#1813]: https://github.com/actix/actix-web/pull/1813 [#1857]: https://github.com/actix/actix-web/pull/1857 @@ -856,29 +917,34 @@
- ## 2.2.2 - 2022-01-21 + ### Changed + - Migrate to `brotli` crate. [ad7e3c06] [ad7e3c06]: https://github.com/actix/actix-web/commit/ad7e3c06 - ## 2.2.1 - 2021-08-09 + ### Fixed + - Potential HTTP request smuggling vulnerabilities. [RUSTSEC-2021-0081](https://github.com/rustsec/advisory-db/pull/977) - ## 2.2.0 - 2020-11-25 + ### Added + - HttpResponse builders for 1xx status codes. [#1768] - `Accept::mime_precedence` and `Accept::mime_preference`. [#1793] - `TryFrom` and `TryFrom` for `http::header::Quality`. [#1797] ### Fixed + - Started dropping `transfer-encoding: chunked` and `Content-Length` for 1XX and 204 responses. [#1767] ### Changed + - Upgrade `serde_urlencoded` to `0.7`. [#1773] [#1773]: https://github.com/actix/actix-web/pull/1773 @@ -887,12 +953,14 @@ [#1793]: https://github.com/actix/actix-web/pull/1793 [#1797]: https://github.com/actix/actix-web/pull/1797 - ## 2.1.0 - 2020-10-30 + ### Added + - Added more flexible `on_connect_ext` methods for on-connect handling. [#1754] ### Changed + - Upgrade `base64` to `0.13`. [#1744] - Upgrade `pin-project` to `1.0`. [#1733] - Deprecate `ResponseBuilder::{if_some, if_true}`. [#1760] @@ -902,37 +970,42 @@ [#1733]: https://github.com/actix/actix-web/pull/1733 [#1744]: https://github.com/actix/actix-web/pull/1744 - ## 2.0.0 - 2020-09-11 + - No significant changes from `2.0.0-beta.4`. - ## 2.0.0-beta.4 - 2020-09-09 + ### Changed + - Update actix-codec and actix-utils dependencies. - Update actix-connect and actix-tls dependencies. - ## 2.0.0-beta.3 - 2020-08-14 + ### Fixed + - Memory leak of `client::pool::ConnectorPoolSupport`. [#1626] [#1626]: https://github.com/actix/actix-web/pull/1626 - ## 2.0.0-beta.2 - 2020-07-21 + ### Fixed + - Potential UB in h1 decoder using uninitialized memory. [#1614] ### Changed + - Fix illegal chunked encoding. [#1615] [#1614]: https://github.com/actix/actix-web/pull/1614 [#1615]: https://github.com/actix/actix-web/pull/1615 - ## 2.0.0-beta.1 - 2020-07-11 + ### Changed + - Migrate cookie handling to `cookie` crate. [#1558] - Update `sha-1` to 0.9. [#1586] - Fix leak in client pool. [#1580] @@ -942,278 +1015,319 @@ [#1586]: https://github.com/actix/actix-web/pull/1586 [#1580]: https://github.com/actix/actix-web/pull/1580 - ## 2.0.0-alpha.4 - 2020-05-21 + ### Changed + - Bump minimum supported Rust version to 1.40 -- content_length function is removed, and you can set Content-Length by calling - no_chunking function [#1439] -- `BodySize::Sized64` variant has been removed. `BodySize::Sized` now receives a - `u64` instead of a `usize`. +- content_length function is removed, and you can set Content-Length by calling no_chunking function [#1439] +- `BodySize::Sized64` variant has been removed. `BodySize::Sized` now receives a `u64` instead of a `usize`. - Update `base64` dependency to 0.12 ### Fixed + - Support parsing of `SameSite=None` [#1503] [#1439]: https://github.com/actix/actix-web/pull/1439 [#1503]: https://github.com/actix/actix-web/pull/1503 - ## 2.0.0-alpha.3 - 2020-05-08 + ### Fixed + - Correct spelling of ConnectError::Unresolved [#1487] -- Fix a mistake in the encoding of websocket continuation messages wherein - Item::FirstText and Item::FirstBinary are each encoded as the other. +- Fix a mistake in the encoding of websocket continuation messages wherein Item::FirstText and Item::FirstBinary are each encoded as the other. ### Changed + - Implement `std::error::Error` for our custom errors [#1422] -- Remove `failure` support for `ResponseError` since that crate - will be deprecated in the near future. +- Remove `failure` support for `ResponseError` since that crate will be deprecated in the near future. [#1422]: https://github.com/actix/actix-web/pull/1422 [#1487]: https://github.com/actix/actix-web/pull/1487 - ## 2.0.0-alpha.2 - 2020-03-07 + ### Changed + - Update `actix-connect` and `actix-tls` dependency to 2.0.0-alpha.1. [#1395] -- Change default initial window size and connection window size for HTTP2 to 2MB and 1MB - respectively to improve download speed for awc when downloading large objects. [#1394] -- client::Connector accepts initial_window_size and initial_connection_window_size - HTTP2 configuration. [#1394] +- Change default initial window size and connection window size for HTTP2 to 2MB and 1MB respectively to improve download speed for awc when downloading large objects. [#1394] +- client::Connector accepts initial_window_size and initial_connection_window_size HTTP2 configuration. [#1394] - client::Connector allowing to set max_http_version to limit HTTP version to be used. [#1394] [#1394]: https://github.com/actix/actix-web/pull/1394 [#1395]: https://github.com/actix/actix-web/pull/1395 - ## 2.0.0-alpha.1 - 2020-02-27 + ### Changed + - Update the `time` dependency to 0.2.7. - Moved actors messages support from actix crate, enabled with feature `actors`. -- Breaking change: trait MessageBody requires Unpin and accepting `Pin<&mut Self>` instead of - `&mut self` in the poll_next(). +- Breaking change: trait MessageBody requires Unpin and accepting `Pin<&mut Self>` instead of `&mut self` in the poll_next(). - MessageBody is not implemented for &'static [u8] anymore. ### Fixed + - Allow `SameSite=None` cookies to be sent in a response. - ## 1.0.1 - 2019-12-20 + ### Fixed + - Poll upgrade service's readiness from HTTP service handlers - Replace brotli with brotli2 #1224 - ## 1.0.0 - 2019-12-13 + ### Added + - Add websockets continuation frame support ### Changed + - Replace `flate2-xxx` features with `compress` - ## 1.0.0-alpha.5 - 2019-12-09 + ### Fixed + - Check `Upgrade` service readiness before calling it - Fix buffer remaining capacity calculation ### Changed + - Websockets: Ping and Pong should have binary data #1049 - ## 1.0.0-alpha.4 - 2019-12-08 + ### Added + - Add impl ResponseBuilder for Error ### Changed + - Use rust based brotli compression library ## 1.0.0-alpha.3 - 2019-12-07 + ### Changed + - Migrate to tokio 0.2 - Migrate to `std::future` - ## 0.2.11 - 2019-11-06 + ### Added + - Add support for serde_json::Value to be passed as argument to ResponseBuilder.body() -- Add an additional `filename*` param in the `Content-Disposition` header of - `actix_files::NamedFile` to be more compatible. (#1151) +- Add an additional `filename*` param in the `Content-Disposition` header of `actix_files::NamedFile` to be more compatible. (#1151) - Allow to use `std::convert::Infallible` as `actix_http::error::Error` ### Fixed -- To be compatible with non-English error responses, `ResponseError` rendered with `text/plain; - charset=utf-8` header [#1118] + +- To be compatible with non-English error responses, `ResponseError` rendered with `text/plain; charset=utf-8` header [#1118] [#1878]: https://github.com/actix/actix-web/pull/1878 - ## 0.2.10 - 2019-09-11 + ### Added -- Add support for sending HTTP requests with `Rc` in addition to sending HTTP requests - with `RequestHead` + +- Add support for sending HTTP requests with `Rc` in addition to sending HTTP requests with `RequestHead` ### Fixed + - h2 will use error response #1080 - on_connect result isn't added to request extensions for http2 requests #1009 - ## 0.2.9 - 2019-08-13 + ### Changed + - Dropped the `byteorder`-dependency in favor of `stdlib`-implementation - Update percent-encoding to 2.1 - Update serde_urlencoded to 0.6.1 ### Fixed + - Fixed a panic in the HTTP2 handshake in client HTTP requests (#1031) - ## 0.2.8 - 2019-08-01 + ### Added + - Add `rustls` support - Add `Clone` impl for `HeaderMap` ### Fixed -- awc client panic #1016 -- Invalid response with compression middleware enabled, but compression-related features - disabled #997 +- awc client panic #1016 +- Invalid response with compression middleware enabled, but compression-related features disabled #997 ## 0.2.7 - 2019-07-18 + ### Added + - Add support for downcasting response errors #986 - ## 0.2.6 - 2019-07-17 + ### Changed + - Replace `ClonableService` with local copy - Upgrade `rand` dependency version to 0.7 - ## 0.2.5 - 2019-06-28 + ### Added + - Add `on-connect` callback, `HttpServiceBuilder::on_connect()` #946 ### Changed + - Use `encoding_rs` crate instead of unmaintained `encoding` crate - Add `Copy` and `Clone` impls for `ws::Codec` - ## 0.2.4 - 2019-06-16 + ### Fixed + - Do not compress NoContent (204) responses #918 - ## 0.2.3 - 2019-06-02 + ### Added + - Debug impl for ResponseBuilder - From SizedStream and BodyStream for Body ### Changed + - SizedStream uses u64 - ## 0.2.2 - 2019-05-29 + ### Fixed + - Parse incoming stream before closing stream on disconnect #868 - ## 0.2.1 - 2019-05-25 + ### Fixed + - Handle socket read disconnect - ## 0.2.0 - 2019-05-12 + ### Changed + - Update actix-service to 0.4 - Expect and upgrade services accept `ServerConfig` config. ### Deleted + - `OneRequest` service - ## 0.1.5 - 2019-05-04 + ### Fixed + - Clean up response extensions in response pool #817 - ## 0.1.4 - 2019-04-24 + ### Added + - Allow to render h1 request headers in `Camel-Case` ### Fixed + - Read until eof for http/1.0 responses #771 - ## 0.1.3 - 2019-04-23 + ### Fixed + - Fix http client pool management - Fix http client wait queue management #794 - ## 0.1.2 - 2019-04-23 + ### Fixed + - Fix BorrowMutError panic in client connector #793 - ## 0.1.1 - 2019-04-19 + ### Changed + - Cookie::max_age() accepts value in seconds - Cookie::max_age_time() accepts value in time::Duration - Allow to specify server address for client connector - ## 0.1.0 - 2019-04-16 + ### Added + - Expose peer addr via `Request::peer_addr()` and `RequestHead::peer_addr` ### Changed + - `actix_http::encoding` always available - use trust-dns-resolver 0.11.0 - ## 0.1.0-alpha.5 - 2019-04-12 + ### Added + - Allow to use custom service for upgrade requests - Added `h1::SendResponse` future. ### Changed + - MessageBody::length() renamed to MessageBody::size() for consistency - ws handshake verification functions take RequestHead instead of Request - ## 0.1.0-alpha.4 - 2019-04-08 + ### Added + - Allow to use custom `Expect` handler - Add minimal `std::error::Error` impl for `Error` ### Changed + - Export IntoHeaderValue - Render error and return as response body - Use thread pool for response body compression ### Deleted + - Removed PayloadBuffer - ## 0.1.0-alpha.3 - 2019-04-02 + ### Added + - Warn when an unsealed private cookie isn't valid UTF-8 ### Fixed + - Rust 1.31.0 compatibility - Preallocate read buffer for h1 codec - Detect socket disconnection during protocol selection - ## 0.1.0-alpha.2 - 2019-03-29 + ### Added + - Added ws::Message::Nop, no-op websockets message ### Changed + - Do not use thread pool for decompression if chunk size is smaller than 2048. - ## 0.1.0-alpha.1 - 2019-03-28 + - Initial impl diff --git a/actix-http/README.md b/actix-http/README.md index 2dd2d248f..aa98f953f 100644 --- a/actix-http/README.md +++ b/actix-http/README.md @@ -14,7 +14,7 @@ ## Documentation & Resources - [API Documentation](https://docs.rs/actix-http) -- Minimum Supported Rust Version (MSRV): 1.54 +- Minimum Supported Rust Version (MSRV): 1.59 ## Example @@ -49,18 +49,3 @@ async fn main() -> io::Result<()> { .await } ``` - -## License - -This project is licensed under either of - -- Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)) -- MIT license ([LICENSE-MIT](LICENSE-MIT) or [http://opensource.org/licenses/MIT](http://opensource.org/licenses/MIT)) - -at your option. - -## Code of Conduct - -Contribution to the actix-http crate is organized under the terms of the -Contributor Covenant, the maintainer of actix-http, @fafhrd91, promises to -intervene to uphold that code of conduct. diff --git a/actix-multipart/CHANGES.md b/actix-multipart/CHANGES.md index 53134db4f..3d93a4921 100644 --- a/actix-multipart/CHANGES.md +++ b/actix-multipart/CHANGES.md @@ -1,45 +1,46 @@ # Changes ## Unreleased - 2022-xx-xx + - Added `MultipartForm` typed data extractor. [#2883] [#2883]: https://github.com/actix/actix-web/pull/2883 - ## 0.5.0 - 2023-01-21 + - `Field::content_type()` now returns `Option<&mime::Mime>`. [#2885] - Minimum supported Rust version (MSRV) is now 1.59 due to transitive `time` dependency. [#2885]: https://github.com/actix/actix-web/pull/2885 - ## 0.4.0 - 2022-02-25 + - No significant changes since `0.4.0-beta.13`. - ## 0.4.0-beta.13 - 2022-01-31 + - No significant changes since `0.4.0-beta.12`. - ## 0.4.0-beta.12 - 2022-01-04 + - Minimum supported Rust version (MSRV) is now 1.54. - ## 0.4.0-beta.11 - 2021-12-27 + - No significant changes since `0.4.0-beta.10`. - ## 0.4.0-beta.10 - 2021-12-11 + - No significant changes since `0.4.0-beta.9`. - ## 0.4.0-beta.9 - 2021-12-01 + - Polling `Field` after dropping `Multipart` now fails immediately instead of hanging forever. [#2463] [#2463]: https://github.com/actix/actix-web/pull/2463 - ## 0.4.0-beta.8 - 2021-11-22 + - Ensure a correct Content-Disposition header is included in every part of a multipart message. [#2451] - Added `MultipartError::NoContentDisposition` variant. [#2451] - Since Content-Disposition is now ensured, `Field::content_disposition` is now infallible. [#2451] @@ -49,52 +50,52 @@ [#2451]: https://github.com/actix/actix-web/pull/2451 - ## 0.4.0-beta.7 - 2021-10-20 + - Minimum supported Rust version (MSRV) is now 1.52. - ## 0.4.0-beta.6 - 2021-09-09 + - Minimum supported Rust version (MSRV) is now 1.51. - ## 0.4.0-beta.5 - 2021-06-17 -- No notable changes. +- No notable changes. ## 0.4.0-beta.4 - 2021-04-02 -- No notable changes. +- No notable changes. ## 0.4.0-beta.3 - 2021-03-09 -- No notable changes. +- No notable changes. ## 0.4.0-beta.2 - 2021-02-10 + - No notable changes. - ## 0.4.0-beta.1 - 2021-01-07 + - Fix multipart consuming payload before header checks. [#1513] - Update `bytes` to `1.0`. [#1813] [#1813]: https://github.com/actix/actix-web/pull/1813 [#1513]: https://github.com/actix/actix-web/pull/1513 - ## 0.3.0 - 2020-09-11 + - No significant changes from `0.3.0-beta.2`. - ## 0.3.0-beta.2 - 2020-09-10 + - Update `actix-*` dependencies to latest versions. - ## 0.3.0-beta.1 - 2020-07-15 + - Update `actix-web` to 3.0.0-beta.1 - ## 0.3.0-alpha.1 - 2020-05-25 + - Update `actix-web` to 3.0.0-alpha.3 - Bump minimum supported Rust version to 1.40 - Minimize `futures` dependencies diff --git a/actix-multipart/README.md b/actix-multipart/README.md index 82587ffc0..23c7aa4f5 100644 --- a/actix-multipart/README.md +++ b/actix-multipart/README.md @@ -14,4 +14,4 @@ ## Documentation & Resources - [API Documentation](https://docs.rs/actix-multipart) -- Minimum Supported Rust Version (MSRV): 1.54 +- Minimum Supported Rust Version (MSRV): 1.59 diff --git a/actix-router/CHANGES.md b/actix-router/CHANGES.md index 51e7cbc10..b3a85d3fe 100644 --- a/actix-router/CHANGES.md +++ b/actix-router/CHANGES.md @@ -2,16 +2,17 @@ ## Unreleased - 2022-xx-xx - ## 0.5.1 - 2022-09-19 + - Correct typo in error string for `i32` deserialization. [#2876] - Minimum supported Rust version (MSRV) is now 1.59 due to transitive `time` dependency. [#2876]: https://github.com/actix/actix-web/pull/2876 - ## 0.5.0 - 2022-02-22 + ### Added + - Add `Path::as_str`. [#2590] - Add `ResourceDef::set_name`. [#373][net#373] - Add `RouterBuilder::push`. [#2612] @@ -23,6 +24,7 @@ - Support multi-pattern prefixes and joins. [#2356] ### Changed + - Change signature of `ResourceDef::capture_match_info_fn` to remove `user_data` parameter. [#2612] - Deprecate `Path::path`. [#2590] - Disallow prefix routes with tail segments. [#379][net#379] @@ -47,6 +49,7 @@ - Return type of `ResourceDef::pattern` is now `Option<&str>`. [#373][net#373] ### Fixed + - Fix `ResourceDef`'s `PartialEq` implementation. [#373][net#373] - Fix segment interpolation leaving `Path` in unintended state after matching. [#368][net#368] - Improve malformed path error message. [#384][net#384] @@ -55,6 +58,7 @@ - Static patterns in multi-patterns are no longer interpreted as regex. [#366][net#366] ### Removed + - `ResourceDef::name_mut`. [#373][net#373] - Unused `ResourceInfo`. [#2612] @@ -77,11 +81,11 @@ [net#380]: https://github.com/actix/actix-net/pull/380 [net#384]: https://github.com/actix/actix-net/pull/384 -
0.5.0 Pre-Releases ## 0.5.0-rc.3 - 2022-01-31 + - Remove unused `ResourceInfo`. [#2612] - Add `RouterBuilder::push`. [#2612] - Change signature of `ResourceDef::capture_match_info_fn` to remove `user_data` parameter. [#2612] @@ -92,33 +96,33 @@ [#2612]: https://github.com/actix/actix-web/pull/2612 [#2613]: https://github.com/actix/actix-web/pull/2613 - ## 0.5.0-rc.2 - 2022-01-21 + - Add `Path::as_str`. [#2590] - Deprecate `Path::path`. [#2590] [#2590]: https://github.com/actix/actix-web/pull/2590 - ## 0.5.0-rc.1 - 2022-01-14 + - `Resource` trait now have an associated type, `Path`, instead of the generic parameter. [#2568] - `Resource` is now implemented for `&mut Path<_>` and `RefMut>`. [#2568] [#2568]: https://github.com/actix/actix-web/pull/2568 - ## 0.5.0-beta.4 - 2022-01-04 + - `PathDeserializer` now decodes all percent encoded characters in dynamic segments. [#2566] - Minimum supported Rust version (MSRV) is now 1.54. [#2566]: https://github.com/actix/actix-net/pull/2566 - ## 0.5.0-beta.3 - 2021-12-17 + - Minimum supported Rust version (MSRV) is now 1.52. - ## 0.5.0-beta.2 - 2021-09-09 + - Introduce `ResourceDef::join`. [#380][net#380] - Disallow prefix routes with tail segments. [#379][net#379] - Enforce path separators on dynamic prefixes. [#378][net#378] @@ -137,8 +141,8 @@ [#2355]: https://github.com/actix/actix-web/pull/2355 [#2356]: https://github.com/actix/actix-web/pull/2356 - ## 0.5.0-beta.1 - 2021-07-20 + - Fix a bug in multi-patterns where static patterns are interpreted as regex. [#366][net#366] - Introduce `ResourceDef::pattern_iter` to get an iterator over all patterns in a multi-pattern resource. [#373][net#373] - Fix segment interpolation leaving `Path` in unintended state after matching. [#368][net#368] @@ -167,8 +171,8 @@
- ## 0.4.0 - 2021-06-06 + - When matching path parameters, `%25` is now kept in the percent-encoded form; no longer decoded to `%`. [#357][net#357] - Path tail patterns now match new lines (`\n`) in request URL. [#360][net#360] - Fixed a safety bug where `Path` could return a malformed string after percent decoding. [#359][net#359] @@ -179,70 +183,70 @@ [net#359]: https://github.com/actix/actix-net/pull/359 [net#360]: https://github.com/actix/actix-net/pull/360 - ## 0.3.0 - 2019-12-31 + - Version was yanked previously. See https://crates.io/crates/actix-router/0.3.0 - ## 0.2.7 - 2021-02-06 + - Add `Router::recognize_checked` [#247][net#247] [net#247]: https://github.com/actix/actix-net/pull/247 - ## 0.2.6 - 2021-01-09 + - Use `bytestring` version range compatible with Bytes v1.0. [#246][net#246] [net#246]: https://github.com/actix/actix-net/pull/246 - ## 0.2.5 - 2020-09-20 + - Fix `from_hex()` method - ## 0.2.4 - 2019-12-31 + - Add `ResourceDef::resource_path_named()` path generation method - ## 0.2.3 - 2019-12-25 + - Add impl `IntoPattern` for `&String` - ## 0.2.2 - 2019-12-25 + - Use `IntoPattern` for `RouterBuilder::path()` - ## 0.2.1 - 2019-12-25 + - Add `IntoPattern` trait - Add multi-pattern resources - ## 0.2.0 - 2019-12-07 + - Update http to 0.2 - Update regex to 1.3 - Use bytestring instead of string - ## 0.1.5 - 2019-05-15 + - Remove debug prints - ## 0.1.4 - 2019-05-15 + - Fix checked resource match - ## 0.1.3 - 2019-04-22 -- Added support for `remainder match` (i.e "/path/{tail}*") +- Added support for `remainder match` (i.e "/path/{tail}\*") ## 0.1.2 - 2019-04-07 + - Export `Quoter` type - Allow to reset `Path` instance - ## 0.1.1 - 2019-04-03 + - Get dynamic segment by name instead of iterator. - ## 0.1.0 - 2019-03-09 + - Initial release diff --git a/actix-test/CHANGES.md b/actix-test/CHANGES.md index c8fe54203..23f4b4db1 100644 --- a/actix-test/CHANGES.md +++ b/actix-test/CHANGES.md @@ -1,72 +1,73 @@ # Changes ## Unreleased - 2022-xx-xx + - Minimum supported Rust version (MSRV) is now 1.59 due to transitive `time` dependency. - ## 0.1.0 - 2022-07-24 + - Minimum supported Rust version (MSRV) is now 1.57 due to transitive `time` dependency. - ## 0.1.0-beta.13 - 2022-02-16 + - No significant changes since `0.1.0-beta.12`. - ## 0.1.0-beta.12 - 2022-01-31 + - Rename `TestServerConfig::{client_timeout => client_request_timeout}`. [#2611] [#2611]: https://github.com/actix/actix-web/pull/2611 - ## 0.1.0-beta.11 - 2022-01-04 + - Minimum supported Rust version (MSRV) is now 1.54. - ## 0.1.0-beta.10 - 2021-12-27 + - No significant changes since `0.1.0-beta.9`. - ## 0.1.0-beta.9 - 2021-12-17 + - Re-export `actix_http::body::to_bytes`. [#2518] - Update `actix_web::test` re-exports. [#2518] [#2518]: https://github.com/actix/actix-web/pull/2518 - ## 0.1.0-beta.8 - 2021-12-11 + - No significant changes since `0.1.0-beta.7`. - ## 0.1.0-beta.7 - 2021-11-22 + - Fix compatibility with experimental `io-uring` feature of `actix-rt`. [#2408] [#2408]: https://github.com/actix/actix-web/pull/2408 - ## 0.1.0-beta.6 - 2021-11-15 + - No significant changes from `0.1.0-beta.5`. - ## 0.1.0-beta.5 - 2021-10-20 + - Updated rustls to v0.20. [#2414] - Minimum supported Rust version (MSRV) is now 1.52. [#2414]: https://github.com/actix/actix-web/pull/2414 - ## 0.1.0-beta.4 - 2021-09-09 + - Minimum supported Rust version (MSRV) is now 1.51. - ## 0.1.0-beta.3 - 2021-06-20 + - No significant changes from `0.1.0-beta.2`. - ## 0.1.0-beta.2 - 2021-04-17 + - No significant changes from `0.1.0-beta.1`. - ## 0.1.0-beta.1 - 2021-04-02 + - Move integration testing structs from `actix-web`. [#2112] [#2112]: https://github.com/actix/actix-web/pull/2112 diff --git a/actix-web-actors/CHANGES.md b/actix-web-actors/CHANGES.md index c66c04d37..480470bee 100644 --- a/actix-web-actors/CHANGES.md +++ b/actix-web-actors/CHANGES.md @@ -2,72 +2,72 @@ ## Unreleased - 2022-xx-xx - ## 4.2.0 - 2023-01-21 + - Minimum supported Rust version (MSRV) is now 1.57 due to transitive `time` dependency. - ## 4.1.0 - 2022-03-02 + - Add support for `actix` version `0.13`. [#2675] [#2675]: https://github.com/actix/actix-web/pull/2675 - ## 4.0.0 - 2022-02-25 + - No significant changes since `4.0.0-beta.12`. - ## 4.0.0-beta.12 - 2022-02-16 + - No significant changes since `4.0.0-beta.11`. - ## 4.0.0-beta.11 - 2022-01-31 + - No significant changes since `4.0.0-beta.10`. - ## 4.0.0-beta.10 - 2022-01-04 + - Minimum supported Rust version (MSRV) is now 1.54. - ## 4.0.0-beta.9 - 2021-12-27 + - No significant changes since `4.0.0-beta.8`. - ## 4.0.0-beta.8 - 2021-12-11 + - Add `ws:WsResponseBuilder` for building WebSocket session response. [#1920] - Deprecate `ws::{start_with_addr, start_with_protocols}`. [#1920] - Minimum supported Rust version (MSRV) is now 1.52. [#1920]: https://github.com/actix/actix-web/pull/1920 - ## 4.0.0-beta.7 - 2021-09-09 + - Minimum supported Rust version (MSRV) is now 1.51. - ## 4.0.0-beta.6 - 2021-06-26 + - Update `actix` to `0.12`. [#2277] [#2277]: https://github.com/actix/actix-web/pull/2277 - ## 4.0.0-beta.5 - 2021-06-17 -- No notable changes. +- No notable changes. ## 4.0.0-beta.4 - 2021-04-02 -- No notable changes. +- No notable changes. ## 4.0.0-beta.3 - 2021-03-09 -- No notable changes. +- No notable changes. ## 4.0.0-beta.2 - 2021-02-10 + - No notable changes. - ## 4.0.0-beta.1 - 2021-01-07 + - Update `pin-project` to `1.0`. - Update `bytes` to `1.0`. [#1813] - `WebsocketContext::text` now takes an `Into`. [#1864] @@ -75,21 +75,21 @@ [#1813]: https://github.com/actix/actix-web/pull/1813 [#1864]: https://github.com/actix/actix-web/pull/1864 - ## 3.0.0 - 2020-09-11 + - No significant changes from `3.0.0-beta.2`. - ## 3.0.0-beta.2 - 2020-09-10 + - Update `actix-*` dependencies to latest versions. - ## [3.0.0-beta.1] - 2020-xx-xx + - Update `actix-web` & `actix-http` dependencies to beta.1 - 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 - Update the actix-http dependency to 2.0.0-alpha.3 @@ -112,8 +112,7 @@ ## [1.0.2] - 2019-07-20 -- Add `ws::start_with_addr()`, returning the address of the created actor, along - with the `HttpResponse`. +- Add `ws::start_with_addr()`, returning the address of the created actor, along with the `HttpResponse`. - Add support for specifying protocols on websocket handshake #835 diff --git a/actix-web-actors/README.md b/actix-web-actors/README.md index 29d766eab..dce91f503 100644 --- a/actix-web-actors/README.md +++ b/actix-web-actors/README.md @@ -14,4 +14,4 @@ ## Documentation & Resources - [API Documentation](https://docs.rs/actix-web-actors) -- Minimum Supported Rust Version (MSRV): 1.54 +- Minimum Supported Rust Version (MSRV): 1.59 diff --git a/actix-web-codegen/CHANGES.md b/actix-web-codegen/CHANGES.md index ffa2cd252..008e4c170 100644 --- a/actix-web-codegen/CHANGES.md +++ b/actix-web-codegen/CHANGES.md @@ -1,47 +1,48 @@ # Changes ## Unreleased - 2022-xx-xx + - Add support for Custom Methods with `#[route]` macro. [#2969] [#2969]: https://github.com/actix/actix-web/pull/2969 - ## 4.1.0 - 2022-09-11 + - Add `#[routes]` macro to support multiple paths for one handler. [#2718] - Minimum supported Rust version (MSRV) is now 1.59 due to transitive `time` dependency. [#2718]: https://github.com/actix/actix-web/pull/2718 - ## 4.0.1 - 2022-06-11 + - Fix support for guard paths in route handler macros. [#2771] - Minimum supported Rust version (MSRV) is now 1.56 due to transitive `hashbrown` dependency. [#2771]: https://github.com/actix/actix-web/pull/2771 - ## 4.0.0 - 2022-02-24 + - Version aligned with `actix-web` and will remain in sync going forward. - No significant changes since `0.5.0`. - ## 0.5.0 - 2022-02-24 + - No significant changes since `0.5.0-rc.2`. - ## 0.5.0-rc.2 - 2022-02-01 + - No significant changes since `0.5.0-rc.1`. - ## 0.5.0-rc.1 - 2022-01-04 + - Minimum supported Rust version (MSRV) is now 1.54. - ## 0.5.0-beta.6 - 2021-12-11 + - No significant changes since `0.5.0-beta.5`. - ## 0.5.0-beta.5 - 2021-10-20 + - Improve error recovery potential when macro input is invalid. [#2410] - Add `#[actix_web::test]` macro for setting up tests with a runtime. [#2409] - Minimum supported Rust version (MSRV) is now 1.52. @@ -49,90 +50,90 @@ [#2410]: https://github.com/actix/actix-web/pull/2410 [#2409]: https://github.com/actix/actix-web/pull/2409 - ## 0.5.0-beta.4 - 2021-09-09 + - In routing macros, paths are now validated at compile time. [#2350] - Minimum supported Rust version (MSRV) is now 1.51. [#2350]: https://github.com/actix/actix-web/pull/2350 - ## 0.5.0-beta.3 - 2021-06-17 + - No notable changes. - ## 0.5.0-beta.2 - 2021-03-09 + - Preserve doc comments when using route macros. [#2022] - Add `name` attribute to `route` macro. [#1934] [#2022]: https://github.com/actix/actix-web/pull/2022 [#1934]: https://github.com/actix/actix-web/pull/1934 - ## 0.5.0-beta.1 - 2021-02-10 + - Use new call signature for `System::new`. - ## 0.4.0 - 2020-09-20 + - Added compile success and failure testing. [#1677] - Add `route` macro for supporting multiple HTTP methods guards. [#1674] [#1677]: https://github.com/actix/actix-web/pull/1677 [#1674]: https://github.com/actix/actix-web/pull/1674 - ## 0.3.0 - 2020-09-11 + - No significant changes from `0.3.0-beta.1`. - ## 0.3.0-beta.1 - 2020-07-14 + - Add main entry-point macro that uses re-exported runtime. [#1559] [#1559]: https://github.com/actix/actix-web/pull/1559 - ## 0.2.2 - 2020-05-23 + - Add resource middleware on actix-web-codegen [#1467] [#1467]: https://github.com/actix/actix-web/pull/1467 - ## 0.2.1 - 2020-02-25 + - Add `#[allow(missing_docs)]` attribute to generated structs [#1368] - Allow the handler function to be named as `config` [#1290] [#1368]: https://github.com/actix/actix-web/issues/1368 [#1290]: https://github.com/actix/actix-web/issues/1290 - ## 0.2.0 - 2019-12-13 + - Generate code for actix-web 2.0 - ## 0.1.3 - 2019-10-14 + - Bump up `syn` & `quote` to 1.0 - Provide better error message - ## 0.1.2 - 2019-06-04 + - Add macros for head, options, trace, connect and patch http methods - ## 0.1.1 - 2019-06-01 + - Add syn "extra-traits" feature - ## 0.1.0 - 2019-05-18 + - Release - ## 0.1.0-beta.1 - 2019-04-20 + - Gen code for actix-web 1.0.0-beta.1 - ## 0.1.0-alpha.6 - 2019-04-14 + - Gen code for actix-web 1.0.0-alpha.6 - ## 0.1.0-alpha.1 - 2019-03-28 + - Initial impl diff --git a/actix-web-codegen/README.md b/actix-web-codegen/README.md index 821236e47..b5eda863c 100644 --- a/actix-web-codegen/README.md +++ b/actix-web-codegen/README.md @@ -14,7 +14,7 @@ ## Documentation & Resources - [API Documentation](https://docs.rs/actix-web-codegen) -- Minimum Supported Rust Version (MSRV): 1.54 +- Minimum Supported Rust Version (MSRV): 1.59 ## Compile Testing diff --git a/actix-web/CHANGES.md b/actix-web/CHANGES.md index 1e6a953f5..2d4b2db51 100644 --- a/actix-web/CHANGES.md +++ b/actix-web/CHANGES.md @@ -3,7 +3,9 @@ ## Unreleased - 2022-xx-xx ## 4.3.0 - 2023-01-21 + ### Added + - Add `ContentDisposition::attachment()` constructor. [#2867] - Add `ErrorHandlers::default_handler()` (as well as `default_handler_{server, client}()`) to make registering handlers for groups of response statuses easier. [#2784] - Add `Logger::custom_response_replace()`. [#2631] @@ -12,6 +14,7 @@ - Add fallible versions of `test` helpers: `try_call_service()`, `try_call_and_read_body_json()`, `try_read_body()`, and `try_read_body_json()`. [#2961] ### Fixed + - Add `Allow` header to `Resource`'s default responses when no routes are matched. [#2949] [#1961]: https://github.com/actix/actix-web/pull/1961 @@ -22,39 +25,45 @@ [#2949]: https://github.com/actix/actix-web/pull/2949 [#2961]: https://github.com/actix/actix-web/pull/2961 - ## 4.2.1 - 2022-09-12 + ### Fixed + - Bump minimum version of `actix-http` dependency to fix compatibility issue. [#2871] [#2871]: https://github.com/actix/actix-web/pull/2871 - ## 4.2.0 - 2022-09-11 + ### Added + - Add `#[routes]` macro to support multiple paths for one handler. [#2718] - Add `ServiceRequest::{parts, request}()` getter methods. [#2786] - Add configuration options for TLS handshake timeout via `HttpServer::{rustls, openssl}_with_config` methods. [#2752] ### Changed + - Minimum supported Rust version (MSRV) is now 1.59 due to transitive `time` dependency. [#2718]: https://github.com/actix/actix-web/pull/2718 [#2752]: https://github.com/actix/actix-web/pull/2752 [#2786]: https://github.com/actix/actix-web/pull/2786 - ## 4.1.0 - 2022-06-11 + ### Added + - Add `ServiceRequest::extract()` to make it easier to use extractors when writing middlewares. [#2647] - Add `Route::wrap()` to allow individual routes to use middleware. [#2725] - Add `ServiceConfig::default_service()`. [#2338] [#2743] - Implement `ResponseError` for `std::convert::Infallible` ### Changed + - Minimum supported Rust version (MSRV) is now 1.56 due to transitive `hashbrown` dependency. ### Fixed + - Clear connection-level data on `HttpRequest` drop. [#2742] [#2338]: https://github.com/actix/actix-web/pull/2338 @@ -63,14 +72,16 @@ [#2742]: https://github.com/actix/actix-web/pull/2742 [#2743]: https://github.com/actix/actix-web/pull/2743 - ## 4.0.1 - 2022-02-25 + ### Fixed + - Use stable version in readme example. - ## 4.0.0 - 2022-02-25 + ### Dependencies + - Updated `actix-*` to Tokio v1-based versions. [#1813] - Updated `actix-web-codegen` to `4.0.0`. - Updated `cookie` to `0.16`. [#2555] @@ -80,6 +91,7 @@ - Updated `tokio` to `1`. ### Added + - Crate Features: - `cookies`; enabled by default. [#2619] - `compress-brotli`; enabled by default. [#2618] @@ -126,6 +138,7 @@ - Connection data set through the `HttpServer::on_connect` callback is now accessible only from the new `HttpRequest::conn_data()` and `ServiceRequest::conn_data()` methods. [#2491] ### Changed + - Functions: - `guard::fn_guard` functions now receives a `&GuardContext`. [#2552] - `guard::Not` is now generic over the type of guard it wraps. [#2552] @@ -191,6 +204,7 @@ - Minimum supported Rust version (MSRV) is now 1.54. ### Fixed + - Auto-negotiation of content encoding is more fault-tolerant when using the `Compress` middleware. [#2501] - Scope and Resource middleware can access data items set on their own layer. [#2288] - Multiple calls to `App::data()` with the same type now keeps the latest call's data. [#1906] @@ -204,11 +218,13 @@ - Added the underlying parse error to `test::read_body_json`'s panic message. [#1812] ### Security + - `cookie` upgrade addresses [`RUSTSEC-2020-0071`]. [`rustsec-2020-0071`]: https://rustsec.org/advisories/RUSTSEC-2020-0071.html ### Removed + - Crate Features: - `compress` feature. [#2065] - Functions: @@ -337,50 +353,58 @@ [#2663]: https://github.com/actix/actix-web/pull/2663 [871ca5e4]: https://github.com/actix/actix-web/commit/871ca5e4ae2bdc22d1ea02701c2992fa8d04aed7 -
4.0.0 Pre-Releases ## 4.0.0-rc.3 - 2022-02-08 + ### Changed + - `middleware::Condition` gained a broader compatibility; `Compat` is needed in fewer cases. [#2635] ### Added + - Implement `Responder` for `Vec`. [#2625] - Re-export `KeepAlive` in `http` mod. [#2625] [#2625]: https://github.com/actix/actix-web/pull/2625 [#2635]: https://github.com/actix/actix-web/pull/2635 - ## 4.0.0-rc.2 - 2022-02-02 + ### Added + - On-by-default `macros` feature flag to enable routing and runtime macros. [#2619] ### Removed + - `rt::{Arbiter, ArbiterHandle}` re-exports. [#2619] [#2619]: https://github.com/actix/actix-web/pull/2619 - ## 4.0.0-rc.1 - 2022-01-31 + ### Changed + - Rename `HttpServer::{client_timeout => client_request_timeout}`. [#2611] - Rename `HttpServer::{client_shutdown => client_disconnect_timeout}`. [#2611] ### Removed + - `impl Future for HttpResponse`. [#2601] [#2601]: https://github.com/actix/actix-web/pull/2601 [#2611]: https://github.com/actix/actix-web/pull/2611 - ## 4.0.0-beta.21 - 2022-01-21 + ### Added + - `HttpResponse::add_removal_cookie`. [#2586] - `Logger::log_target`. [#2594] ### Removed + - `HttpRequest::req_data[_mut]()`; request-local data is still available through `.extensions()`. [#2585] - `HttpRequestBuilder::del_cookie`. [#2591] @@ -389,13 +413,15 @@ [#2591]: https://github.com/actix/actix-web/pull/2591 [#2594]: https://github.com/actix/actix-web/pull/2594 - ## 4.0.0-beta.20 - 2022-01-14 + ### Added + - `GuardContext::header` [#2569] - `ServiceConfig::configure` to allow easy nesting of configuration functions. [#1988] ### Changed + - `HttpResponse` can now be used as a `Responder` with any body type. [#2567] - `Result` extractor wrapper can now convert error types. [#2581] - Associated types in `FromRequest` impl for `Option` and `Result` has changed. [#2581] @@ -409,52 +435,61 @@ [#2582]: https://github.com/actix/actix-web/pull/2582 [#2584]: https://github.com/actix/actix-web/pull/2584 - ## 4.0.0-beta.19 - 2022-01-04 + ### Added + - `impl Hash` for `http::header::Encoding`. [#2501] - `AcceptEncoding::negotiate()`. [#2501] ### Changed + - `AcceptEncoding::preference` now returns `Option>`. [#2501] - Rename methods `BodyEncoding::{encoding => encode_with, get_encoding => preferred_encoding}`. [#2501] - `http::header::Encoding` now only represents `Content-Encoding` types. [#2501] ### Fixed + - Auto-negotiation of content encoding is more fault-tolerant when using the `Compress` middleware. [#2501] ### Removed + - `Compress::new`; restricting compression algorithm is done through feature flags. [#2501] - `BodyEncoding` trait; signalling content encoding is now only done via the `Content-Encoding` header. [#2565] [#2501]: https://github.com/actix/actix-web/pull/2501 [#2565]: https://github.com/actix/actix-web/pull/2565 - ## 4.0.0-beta.18 - 2021-12-29 + ### Changed + - Update `cookie` dependency (re-exported) to `0.16`. [#2555] - Minimum supported Rust version (MSRV) is now 1.54. ### Security + - `cookie` upgrade addresses [`RUSTSEC-2020-0071`]. [#2555]: https://github.com/actix/actix-web/pull/2555 [`RUSTSEC-2020-0071`]: https://rustsec.org/advisories/RUSTSEC-2020-0071.html - ## 4.0.0-beta.17 - 2021-12-29 + ### Added + - `guard::GuardContext` for use with the `Guard` trait. [#2552] - `ServiceRequest::guard_ctx` for obtaining a guard context. [#2552] ### Changed + - `Guard` trait now receives a `&GuardContext`. [#2552] - `guard::fn_guard` functions now receives a `&GuardContext`. [#2552] - Some guards now return `impl Guard` and their concrete types are made private: `guard::Header` and all the method guards. [#2552] - The `Not` guard is now generic over the type of guard it wraps. [#2552] ### Fixed + - Rename `ConnectionInfo::{remote_addr => peer_addr}`, deprecating the old name. [#2554] - `ConnectionInfo::peer_addr` will not return the port number. [#2554] - `ConnectionInfo::realip_remote_addr` will not return the port number if sourcing the IP from the peer's socket address. [#2554] @@ -462,22 +497,25 @@ [#2552]: https://github.com/actix/actix-web/pull/2552 [#2554]: https://github.com/actix/actix-web/pull/2554 - ## 4.0.0-beta.16 - 2021-12-27 + ### Changed + - No longer require `Scope` service body type to be boxed. [#2523] - No longer require `Resource` service body type to be boxed. [#2526] [#2523]: https://github.com/actix/actix-web/pull/2523 [#2526]: https://github.com/actix/actix-web/pull/2526 - ## 4.0.0-beta.15 - 2021-12-17 + ### Added + - Method on `Responder` trait (`customize`) for customizing responders and `CustomizeResponder` struct. [#2510] - Implement `Debug` for `DefaultHeaders`. [#2510] ### Changed + - Align `DefaultHeader` method terminology, deprecating previous methods. [#2510] - Response service types in `ErrorHandlers` middleware now use `ServiceResponse>` to allow changing the body type. [#2515] - Both variants in `ErrorHandlerResponse` now use `ServiceResponse>`. [#2515] @@ -487,6 +525,7 @@ - Relax body type and error bounds on test utilities. [#2518] ### Removed + - Top-level `EitherExtractError` export. [#2510] - Conversion implementations for `either` crate. [#2516] - `test::load_stream` and `test::load_body`; replace usage with `body::to_bytes`. [#2518] @@ -496,9 +535,10 @@ [#2516]: https://github.com/actix/actix-web/pull/2516 [#2518]: https://github.com/actix/actix-web/pull/2518 - ## 4.0.0-beta.14 - 2021-12-11 + ### Added + - Methods on `AcceptLanguage`: `ranked` and `preference`. [#2480] - `AcceptEncoding` typed header. [#2482] - `Range` typed header. [#2485] @@ -509,6 +549,7 @@ - `ServiceResponse::into_parts`. [#2499] ### Changed + - Rename `Accept::{mime_precedence => ranked}`. [#2480] - Rename `Accept::{mime_preference => preference}`. [#2480] - Un-deprecate `App::data_factory`. [#2484] @@ -518,11 +559,13 @@ - Request-local data container is no longer part of a `RequestHead`. Instead it is a distinct part of a `Request`. [#2487] ### Fixed + - Accept wildcard `*` items in `AcceptLanguage`. [#2480] - Re-exports `dev::{BodySize, MessageBody, SizedStream}`. They are exposed through the `body` module. [#2468] - Typed headers containing lists that require one or more items now enforce this minimum. [#2482] ### Removed + - `ConnectionInfo::get`. [#2487] [#2430]: https://github.com/actix/actix-web/pull/2430 @@ -537,46 +580,54 @@ [#2493]: https://github.com/actix/actix-web/pull/2493 [#2499]: https://github.com/actix/actix-web/pull/2499 - ## 4.0.0-beta.13 - 2021-11-30 + ### Changed + - Update `actix-tls` to `3.0.0-rc.1`. [#2474] [#2474]: https://github.com/actix/actix-web/pull/2474 - ## 4.0.0-beta.12 - 2021-11-22 + ### Changed + - Compress middleware's response type is now `AnyBody>`. [#2448] ### Fixed + - Relax `Unpin` bound on `S` (stream) parameter of `HttpResponseBuilder::streaming`. [#2448] ### Removed + - `dev::ResponseBody` re-export; is function is replaced by the new `dev::AnyBody` enum. [#2446] [#2446]: https://github.com/actix/actix-web/pull/2446 [#2448]: https://github.com/actix/actix-web/pull/2448 - ## 4.0.0-beta.11 - 2021-11-15 + ### Added + - Re-export `dev::ServerHandle` from `actix-server`. [#2442] ### Changed + - `ContentType::html` now produces `text/html; charset=utf-8` instead of `text/html`. [#2423] - Update `actix-server` to `2.0.0-beta.9`. [#2442] [#2423]: https://github.com/actix/actix-web/pull/2423 [#2442]: https://github.com/actix/actix-web/pull/2442 - ## 4.0.0-beta.10 - 2021-10-20 + ### Added + - Option to allow `Json` extractor to work without a `Content-Type` header present. [#2362] - `#[actix_web::test]` macro for setting up tests with a runtime. [#2409] ### Changed + - Associated type `FromRequest::Config` was removed. [#2233] - Inner field made private on `web::Payload`. [#2384] - `Data::into_inner` and `Data::get_ref` no longer requires `T: Sized`. [#2403] @@ -584,6 +635,7 @@ - Minimum supported Rust version (MSRV) is now 1.52. ### Removed + - Useless `ServiceResponse::checked_expr` method. [#2401] [#2233]: https://github.com/actix/actix-web/pull/2233 @@ -594,18 +646,21 @@ [#2409]: https://github.com/actix/actix-web/pull/2409 [#2414]: https://github.com/actix/actix-web/pull/2414 - ## 4.0.0-beta.9 - 2021-09-09 + ### Added + - Re-export actix-service `ServiceFactory` in `dev` module. [#2325] ### Changed + - Compress middleware will return 406 Not Acceptable when no content encoding is acceptable to the client. [#2344] - Move `BaseHttpResponse` to `dev::Response`. [#2379] - Enable `TestRequest::param` to accept more than just static strings. [#2172] - Minimum supported Rust version (MSRV) is now 1.51. ### Fixed + - Fix quality parse error in Accept-Encoding header. [#2344] - Re-export correct type at `web::HttpResponse`. [#2379] @@ -614,20 +669,23 @@ [#2344]: https://github.com/actix/actix-web/pull/2344 [#2379]: https://github.com/actix/actix-web/pull/2379 - ## 4.0.0-beta.8 - 2021-06-26 + ### Added + - Add `ServiceRequest::parts_mut`. [#2177] - Add extractors for `Uri` and `Method`. [#2263] - Add extractors for `ConnectionInfo` and `PeerAddr`. [#2263] - Add `Route::service` for using hand-written services as handlers. [#2262] ### Changed + - Change compression algorithm features flags. [#2250] - Deprecate `App::data` and `App::data_factory`. [#2271] - Smarter extraction of `ConnectionInfo` parts. [#2282] ### Fixed + - Scope and Resource middleware can access data items set on their own layer. [#2288] [#2177]: https://github.com/actix/actix-web/pull/2177 @@ -638,12 +696,14 @@ [#2282]: https://github.com/actix/actix-web/pull/2282 [#2288]: https://github.com/actix/actix-web/pull/2288 - ## 4.0.0-beta.7 - 2021-06-17 + ### Added + - `HttpServer::worker_max_blocking_threads` for setting block thread pool. [#2200] ### Changed + - Adjusted default JSON payload limit to 2MB (from 32kb) and included size and limits in the `JsonPayloadError::Overflow` error variant. [#2162] - `ServiceResponse::error_response` now uses body type of `Body`. [#2201] - `ServiceResponse::checked_expr` now returns a `Result`. [#2201] @@ -656,6 +716,7 @@ - `middleware::normalize` now will not try to normalize URIs with no valid path [#2246] ### Removed + - `HttpResponse::take_body` and old `HttpResponse::into_body` method that casted body type. [#2201] [#2162]: https://github.com/actix/actix-web/pull/2162 @@ -664,36 +725,39 @@ [#2253]: https://github.com/actix/actix-web/pull/2253 [#2246]: https://github.com/actix/actix-web/pull/2246 - ## 4.0.0-beta.6 - 2021-04-17 + ### Added + - `HttpResponse` and `HttpResponseBuilder` types. [#2065] ### Changed + - Most error types are now marked `#[non_exhaustive]`. [#2148] - Methods on `ContentDisposition` that took `T: AsRef` now take `impl AsRef`. [#2065]: https://github.com/actix/actix-web/pull/2065 [#2148]: https://github.com/actix/actix-web/pull/2148 - ## 4.0.0-beta.5 - 2021-04-02 + ### Added + - `Header` extractor for extracting common HTTP headers in handlers. [#2094] - Added `TestServer::client_headers` method. [#2097] ### Changed -- `CustomResponder` would return error as `HttpResponse` when `CustomResponder::with_header` failed - instead of skipping. (Only the first error is kept when multiple error occur) [#2093] + +- `CustomResponder` would return error as `HttpResponse` when `CustomResponder::with_header` failed instead of skipping. (Only the first error is kept when multiple error occur) [#2093] ### Fixed + - Double ampersand in Logger format is escaped correctly. [#2067] ### Removed -- The `client` mod was removed. Clients should now use `awc` directly. - [871ca5e4](https://github.com/actix/actix-web/commit/871ca5e4ae2bdc22d1ea02701c2992fa8d04aed7) -- Integration testing was moved to new `actix-test` crate. Namely these items from the `test` - module: `TestServer`, `TestServerConfig`, `start`, `start_with`, and `unused_addr`. [#2112] + +- The `client` mod was removed. Clients should now use `awc` directly. [871ca5e4](https://github.com/actix/actix-web/commit/871ca5e4ae2bdc22d1ea02701c2992fa8d04aed7) +- Integration testing was moved to new `actix-test` crate. Namely these items from the `test` module: `TestServer`, `TestServerConfig`, `start`, `start_with`, and `unused_addr`. [#2112] [#2067]: https://github.com/actix/actix-web/pull/2067 [#2093]: https://github.com/actix/actix-web/pull/2093 @@ -701,50 +765,48 @@ [#2097]: https://github.com/actix/actix-web/pull/2097 [#2112]: https://github.com/actix/actix-web/pull/2112 - ## 4.0.0-beta.4 - 2021-03-09 + ### Changed + - Feature `cookies` is now optional and enabled by default. [#1981] -- `JsonBody::new` returns a default limit of 32kB to be consistent with `JsonConfig` and the default - behaviour of the `web::Json` extractor. [#2010] +- `JsonBody::new` returns a default limit of 32kB to be consistent with `JsonConfig` and the default behaviour of the `web::Json` extractor. [#2010] [#1981]: https://github.com/actix/actix-web/pull/1981 [#2010]: https://github.com/actix/actix-web/pull/2010 - ## 4.0.0-beta.3 - 2021-02-10 + - Update `actix-web-codegen` to `0.5.0-beta.1`. - ## 4.0.0-beta.2 - 2021-02-10 + ### Added -- The method `Either, web::Form>::into_inner()` which returns the inner type for - whichever variant was created. Also works for `Either, web::Json>`. [#1894] + +- The method `Either, web::Form>::into_inner()` which returns the inner type for whichever variant was created. Also works for `Either, web::Json>`. [#1894] - Add `services!` macro for helping register multiple services to `App`. [#1933] - Enable registering a vec of services of the same type to `App` [#1933] ### Changed -- Rework `Responder` trait to be sync and returns `Response`/`HttpResponse` directly. - Making it simpler and more performant. [#1891] + +- Rework `Responder` trait to be sync and returns `Response`/`HttpResponse` directly. Making it simpler and more performant. [#1891] - `ServiceRequest::into_parts` and `ServiceRequest::from_parts` can no longer fail. [#1893] - `ServiceRequest::from_request` can no longer fail. [#1893] - Our `Either` type now uses `Left`/`Right` variants (instead of `A`/`B`) [#1894] -- `test::{call_service, read_response, read_response_json, send_request}` take `&Service` - in argument [#1905] -- `App::wrap_fn`, `Resource::wrap_fn` and `Scope::wrap_fn` provide `&Service` in closure - argument. [#1905] +- `test::{call_service, read_response, read_response_json, send_request}` take `&Service` in argument [#1905] +- `App::wrap_fn`, `Resource::wrap_fn` and `Scope::wrap_fn` provide `&Service` in closure argument. [#1905] - `web::block` no longer requires the output is a Result. [#1957] ### Fixed + - Multiple calls to `App::data` with the same type now keeps the latest call's data. [#1906] ### Removed + - Public field of `web::Path` has been made private. [#1894] - Public field of `web::Query` has been made private. [#1894] - `TestRequest::with_header`; use `TestRequest::default().insert_header()`. [#1869] -- `AppService::set_service_data`; for custom HTTP service factories adding application data, use the - layered data model by calling `ServiceRequest::add_data_container` when handling - requests instead. [#1906] +- `AppService::set_service_data`; for custom HTTP service factories adding application data, use the layered data model by calling `ServiceRequest::add_data_container` when handling requests instead. [#1906] [#1891]: https://github.com/actix/actix-web/pull/1891 [#1893]: https://github.com/actix/actix-web/pull/1893 @@ -755,30 +817,30 @@ [#1933]: https://github.com/actix/actix-web/pull/1933 [#1957]: https://github.com/actix/actix-web/pull/1957 - ## 4.0.0-beta.1 - 2021-01-07 + ### Added -- `Compat` middleware enabling generic response body/error type of middlewares like `Logger` and - `Compress` to be used in `middleware::Condition` and `Resource`, `Scope` services. [#1865] + +- `Compat` middleware enabling generic response body/error type of middlewares like `Logger` and `Compress` to be used in `middleware::Condition` and `Resource`, `Scope` services. [#1865] ### Changed + - Update `actix-*` dependencies to tokio `1.0` based versions. [#1813] - Bumped `rand` to `0.8`. - Update `rust-tls` to `0.19`. [#1813] - Rename `Handler` to `HandlerService` and rename `Factory` to `Handler`. [#1852] -- The default `TrailingSlash` is now `Trim`, in line with existing documentation. See migration - guide for implications. [#1875] +- The default `TrailingSlash` is now `Trim`, in line with existing documentation. See migration guide for implications. [#1875] - Rename `DefaultHeaders::{content_type => add_content_type}`. [#1875] - MSRV is now 1.46.0. ### Fixed + - Added the underlying parse error to `test::read_body_json`'s panic message. [#1812] ### Removed -- Public modules `middleware::{normalize, err_handlers}`. All necessary middleware types are now - exposed directly by the `middleware` module. -- Remove `actix-threadpool` as dependency. `actix_threadpool::BlockingError` error type can be imported - from `actix_web::error` module. [#1878] + +- Public modules `middleware::{normalize, err_handlers}`. All necessary middleware types are now exposed directly by the `middleware` module. +- Remove `actix-threadpool` as dependency. `actix_threadpool::BlockingError` error type can be imported from `actix_web::error` module. [#1878] [#1812]: https://github.com/actix/actix-web/pull/1812 [#1813]: https://github.com/actix/actix-web/pull/1813 @@ -790,14 +852,17 @@
## 3.3.3 - 2021-12-18 + ### Changed + - Soft-deprecate `NormalizePath::default()`, noting upcoming behavior change in v4. [#2529] [#2529]: https://github.com/actix/actix-web/pull/2529 - ## 3.3.2 - 2020-12-01 + ### Fixed + - Removed an occasional `unwrap` on `None` panic in `NormalizePathNormalization`. [#1762] - Fix `match_pattern()` returning `None` for scope with empty path resource. [#1798] - Increase minimum `socket2` version. [#1803] @@ -806,24 +871,27 @@ [#1798]: https://github.com/actix/actix-web/pull/1798 [#1803]: https://github.com/actix/actix-web/pull/1803 - ## 3.3.1 - 2020-11-29 + - Ensure `actix-http` dependency uses same `serde_urlencoded`. - ## 3.3.0 - 2020-11-25 + ### Added + - Add `Either` extractor helper. [#1788] ### Changed + - Upgrade `serde_urlencoded` to `0.7`. [#1773] [#1773]: https://github.com/actix/actix-web/pull/1773 [#1788]: https://github.com/actix/actix-web/pull/1788 - ## 3.2.0 - 2020-10-30 + ### Added + - Implement `exclude_regex` for Logger middleware. [#1723] - Add request-local data extractor `web::ReqData`. [#1748] - Add ability to register closure for request middleware logging. [#1749] @@ -831,6 +899,7 @@ - Expose `on_connect` for access to the connection stream before request is handled. [#1754] ### Changed + - Updated actix-web-codegen dependency for access to new `#[route(...)]` multi-method macro. - Print non-configured `Data` type when attempting extraction. [#1743] - Re-export bytes::Buf{Mut} in web module. [#1750] @@ -843,52 +912,53 @@ [#1754]: https://github.com/actix/actix-web/pull/1754 [#1749]: https://github.com/actix/actix-web/pull/1749 - ## 3.1.0 - 2020-09-29 + ### Changed -- Add `TrailingSlash::MergeOnly` behaviour to `NormalizePath`, which allows `NormalizePath` - to retain any trailing slashes. [#1695] -- Remove bound `std::marker::Sized` from `web::Data` to support storing `Arc` - via `web::Data::from` [#1710] + +- Add `TrailingSlash::MergeOnly` behaviour to `NormalizePath`, which allows `NormalizePath` to retain any trailing slashes. [#1695] +- Remove bound `std::marker::Sized` from `web::Data` to support storing `Arc` via `web::Data::from` [#1710] ### Fixed + - `ResourceMap` debug printing is no longer infinitely recursive. [#1708] [#1695]: https://github.com/actix/actix-web/pull/1695 [#1708]: https://github.com/actix/actix-web/pull/1708 [#1710]: https://github.com/actix/actix-web/pull/1710 - ## 3.0.2 - 2020-09-15 + ### Fixed + - `NormalizePath` when used with `TrailingSlash::Trim` no longer trims the root path "/". [#1678] [#1678]: https://github.com/actix/actix-web/pull/1678 - ## 3.0.1 - 2020-09-13 + ### Changed + - `middleware::normalize::TrailingSlash` enum is now accessible. [#1673] [#1673]: https://github.com/actix/actix-web/pull/1673 - ## 3.0.0 - 2020-09-11 + - No significant changes from `3.0.0-beta.4`. - ## 3.0.0-beta.4 - 2020-09-09 + ### Added -- `middleware::NormalizePath` now has configurable behavior for either always having a trailing - slash, or as the new addition, always trimming trailing slashes. [#1639] + +- `middleware::NormalizePath` now has configurable behavior for either always having a trailing slash, or as the new addition, always trimming trailing slashes. [#1639] ### Changed + - Update actix-codec and actix-utils dependencies. [#1634] -- `FormConfig` and `JsonConfig` configurations are now also considered when set - using `App::data`. [#1641] +- `FormConfig` and `JsonConfig` configurations are now also considered when set using `App::data`. [#1641] - `HttpServer::maxconn` is renamed to the more expressive `HttpServer::max_connections`. [#1655] -- `HttpServer::maxconnrate` is renamed to the more expressive - `HttpServer::max_connection_rate`. [#1655] +- `HttpServer::maxconnrate` is renamed to the more expressive `HttpServer::max_connection_rate`. [#1655] [#1639]: https://github.com/actix/actix-web/pull/1639 [#1641]: https://github.com/actix/actix-web/pull/1641 @@ -896,22 +966,23 @@ [#1655]: https://github.com/actix/actix-web/pull/1655 ## 3.0.0-beta.3 - 2020-08-17 + ### Changed + - Update `rustls` to 0.18 - ## 3.0.0-beta.2 - 2020-08-17 + ### Changed -- `PayloadConfig` is now also considered in `Bytes` and `String` extractors when set - using `App::data`. [#1610] -- `web::Path` now has a public representation: `web::Path(pub T)` that enables - destructuring. [#1594] -- `ServiceRequest::app_data` allows retrieval of non-Data data without splitting into parts to - access `HttpRequest` which already allows this. [#1618] + +- `PayloadConfig` is now also considered in `Bytes` and `String` extractors when set using `App::data`. [#1610] +- `web::Path` now has a public representation: `web::Path(pub T)` that enables destructuring. [#1594] +- `ServiceRequest::app_data` allows retrieval of non-Data data without splitting into parts to access `HttpRequest` which already allows this. [#1618] - Re-export all error types from `awc`. [#1621] - MSRV is now 1.42.0. ### Fixed + - Memory leak of app data in pooled requests. [#1609] [#1594]: https://github.com/actix/actix-web/pull/1594 @@ -920,28 +991,32 @@ [#1618]: https://github.com/actix/actix-web/pull/1618 [#1621]: https://github.com/actix/actix-web/pull/1621 - ## 3.0.0-beta.1 - 2020-07-13 + ### Added + - Re-export `actix_rt::main` as `actix_web::main`. -- `HttpRequest::match_pattern` and `ServiceRequest::match_pattern` for extracting the matched - resource pattern. +- `HttpRequest::match_pattern` and `ServiceRequest::match_pattern` for extracting the matched resource pattern. - `HttpRequest::match_name` and `ServiceRequest::match_name` for extracting matched resource name. ### Changed + - Fix actix_http::h1::dispatcher so it returns when HW_BUFFER_SIZE is reached. Should reduce peak memory consumption during large uploads. [#1550] - Migrate cookie handling to `cookie` crate. Actix-web no longer requires `ring` dependency. - MSRV is now 1.41.1 ### Fixed + - `NormalizePath` improved consistency when path needs slashes added _and_ removed. - ## 3.0.0-alpha.3 - 2020-05-21 + ### Added + - Add option to create `Data` from `Arc` [#1509] ### Changed + - Resources and Scopes can now access non-overridden data types set on App (or containing scopes) when setting their own data. [#1486] - Fix audit issue logging by default peer address [#1485] - Bump minimum supported Rust version to 1.40 @@ -964,7 +1039,6 @@ [#1452]: https://github.com/actix/actix-web/pull/1452 [#1486]: https://github.com/actix/actix-web/pull/1486 - ## [3.0.0-alpha.1] - 2020-03-11 ### Added @@ -1010,7 +1084,6 @@ - Fix `AppConfig::secure()` is always false. #1202 - ## [2.0.0-alpha.6] - 2019-12-15 ### Fixed @@ -1035,7 +1108,6 @@ - Migrate to tokio 0.2 - ## [2.0.0-alpha.1] - 2019-11-22 ### Changed @@ -1044,7 +1116,6 @@ - Remove implementation of `Responder` for `()`. (#1167) - ## [1.0.9] - 2019-11-14 ### Added @@ -1055,20 +1126,17 @@ - Support `Host` guards when the `Host` header is unset (e.g. HTTP/2 requests) (#1129) - ## [1.0.8] - 2019-09-25 ### Added -- Add `Scope::register_data` and `Resource::register_data` methods, parallel to - `App::register_data`. +- Add `Scope::register_data` and `Resource::register_data` methods, parallel to `App::register_data`. - Add `middleware::Condition` that conditionally enables another middleware - Allow to re-construct `ServiceRequest` from `HttpRequest` and `Payload` -- Add `HttpServer::listen_uds` for ability to listen on UDS FD rather than path, - which is useful for example with systemd. +- Add `HttpServer::listen_uds` for ability to listen on UDS FD rather than path, which is useful for example with systemd. ### Changed @@ -1076,14 +1144,12 @@ - Use actix-testing for testing utils - ## [1.0.7] - 2019-08-29 ### Fixed - Request Extensions leak #1062 - ## [1.0.6] - 2019-08-28 ### Added @@ -1094,8 +1160,7 @@ - Add `into_inner` to `Data` -- Add `test::TestRequest::set_form()` convenience method to automatically serialize data and set - the header in test requests. +- Add `test::TestRequest::set_form()` convenience method to automatically serialize data and set the header in test requests. ### Changed @@ -1107,35 +1172,30 @@ - Update url to 2.1 - ## [1.0.5] - 2019-07-18 ### Added - Unix domain sockets (HttpServer::bind_uds) #92 -- Actix now logs errors resulting in "internal server error" responses always, with the `error` - logging level +- Actix now logs errors resulting in "internal server error" responses always, with the `error` logging level ### Fixed - Restored logging of errors through the `Logger` middleware - ## [1.0.4] - 2019-07-17 ### Added - Add `Responder` impl for `(T, StatusCode) where T: Responder` -- Allow to access app's resource map via - `ServiceRequest::resource_map()` and `HttpRequest::resource_map()` methods. +- Allow to access app's resource map via `ServiceRequest::resource_map()` and `HttpRequest::resource_map()` methods. ### Changed - Upgrade `rand` dependency version to 0.7 - ## [1.0.3] - 2019-06-28 ### Added @@ -1144,8 +1204,7 @@ ### Changed -- Use `encoding_rs` crate instead of unmaintained `encoding` crate - +- Use `encoding_rs` crate instead of unmaintained `encoding` crate ## [1.0.2] - 2019-06-17 @@ -1155,7 +1214,6 @@ - Move identity middleware to `actix-identity` crate. - ## [1.0.1] - 2019-06-17 ### Added @@ -1180,7 +1238,6 @@ - HttpRequest::url_for is broken with nested scopes #915 - ## [1.0.0] - 2019-06-05 ### Added @@ -1189,8 +1246,7 @@ - Add `ServiceRequest::set_payload()` method. -- Add `test::TestRequest::set_json()` convenience method to automatically - serialize data and set header in test requests. +- Add `test::TestRequest::set_json()` convenience method to automatically serialize data and set header in test requests. - Add macros for head, options, trace, connect and patch http methods @@ -1204,7 +1260,6 @@ - Clear http requests pool on app service drop #860 - ## [1.0.0-rc] - 2019-05-18 ### Added @@ -1220,7 +1275,6 @@ - Codegen with parameters in the path only resolves the first registered endpoint #841 - ## [1.0.0-beta.4] - 2019-05-12 ### Added @@ -1232,7 +1286,6 @@ - `App::configure` take an `FnOnce` instead of `Fn` - Upgrade actix-net crates - ## [1.0.0-beta.3] - 2019-05-04 ### Added @@ -1241,11 +1294,9 @@ ### Changed -- Extractor configuration could be registered with `App::data()` - or with `Resource::data()` #775 +- Extractor configuration could be registered with `App::data()` or with `Resource::data()` #775 -- Route data is unified with app data, `Route::data()` moved to resource - level to `Resource::data()` +- Route data is unified with app data, `Route::data()` moved to resource level to `Resource::data()` - CORS handling without headers #702 @@ -1259,7 +1310,6 @@ - `App::data_factory()` is deleted. - ## [1.0.0-beta.2] - 2019-04-24 ### Added @@ -1268,7 +1318,7 @@ - Add helper functions for reading response body `test::read_body()` -- Add support for `remainder match` (i.e "/path/{tail}*") +- Add support for `remainder match` (i.e "/path/{tail}\*") - Extend `Responder` trait, allow to override status code and headers. @@ -1282,13 +1332,11 @@ - Fix async web::Data factory handling - ## [1.0.0-beta.1] - 2019-04-20 ### Added -- Add helper functions for reading test response body, - `test::read_response()` and test::read_response_json()` +- Add helper functions for reading test response body, `test::read_response()` and test::read_response_json()` - Add `.peer_addr()` #744 @@ -1308,7 +1356,6 @@ - Fixed `TestRequest::app_data()` - ## [1.0.0-alpha.6] - 2019-04-14 ### Changed @@ -1317,12 +1364,10 @@ - Remove generic type for request payload, always use default. -- Removed `Decompress` middleware. Bytes, String, Json, Form extractors - automatically decompress payload. +- Removed `Decompress` middleware. Bytes, String, Json, Form extractors automatically decompress payload. - Make extractor config type explicit. Add `FromRequest::Config` associated type. - ## [1.0.0-alpha.5] - 2019-04-12 ### Added @@ -1333,7 +1378,6 @@ - Removed native-tls support - ## [1.0.0-alpha.4] - 2019-04-08 ### Added @@ -1356,7 +1400,6 @@ - Fix body propagation in Response::from_error. #760 - ## [1.0.0-alpha.3] - 2019-04-02 ### Changed @@ -1371,7 +1414,6 @@ - Removed unused `actix_web::web::md()` - ## [1.0.0-alpha.2] - 2019-03-29 ### Added diff --git a/actix-web/MIGRATION-0.x.md b/actix-web/MIGRATION-0.x.md index 1b60c36d1..6af514642 100644 --- a/actix-web/MIGRATION-0.x.md +++ b/actix-web/MIGRATION-0.x.md @@ -1,7 +1,6 @@ # 0.7.15 -- The `' '` character is not percent decoded anymore before matching routes. If you need to use it in - your routes, you should use `%20`. +- The `' '` character is not percent decoded anymore before matching routes. If you need to use it in your routes, you should use `%20`. instead of @@ -29,13 +28,11 @@ fn main() { # 0.7.4 -- `Route::with_config()`/`Route::with_async_config()` always passes configuration objects as tuple - even for handler with one parameter. +- `Route::with_config()`/`Route::with_async_config()` always passes configuration objects as tuple even for handler with one parameter. # 0.7 -- `HttpRequest` does not implement `Stream` anymore. If you need to read request payload - use `HttpMessage::payload()` method. +- `HttpRequest` does not implement `Stream` anymore. If you need to read request payload use `HttpMessage::payload()` method. instead of @@ -60,8 +57,7 @@ fn index(req: HttpRequest) -> impl Responder { } ``` -- [Middleware](https://actix.rs/actix-web/actix_web/middleware/trait.Middleware.html) - trait uses `&HttpRequest` instead of `&mut HttpRequest`. +- [Middleware](https://actix.rs/actix-web/actix_web/middleware/trait.Middleware.html) trait uses `&HttpRequest` instead of `&mut HttpRequest`. - Removed `Route::with2()` and `Route::with3()` use tuple of extractors instead. @@ -81,14 +77,11 @@ fn index((query, json): (Query<..>, Json impl Responder {} - `Handler::handle()` accepts reference to `HttpRequest<_>` instead of value -- Removed deprecated `HttpServer::threads()`, use - [HttpServer::workers()](https://actix.rs/actix-web/actix_web/server/struct.HttpServer.html#method.workers) instead. +- Removed deprecated `HttpServer::threads()`, use [HttpServer::workers()](https://actix.rs/actix-web/actix_web/server/struct.HttpServer.html#method.workers) instead. -- Renamed `client::ClientConnectorError::Connector` to - `client::ClientConnectorError::Resolver` +- Renamed `client::ClientConnectorError::Connector` to `client::ClientConnectorError::Resolver` -- `Route::with()` does not return `ExtractorConfig`, to configure - extractor use `Route::with_config()` +- `Route::with()` does not return `ExtractorConfig`, to configure extractor use `Route::with_config()` instead of @@ -116,23 +109,19 @@ fn main() { } ``` -- `Route::with_async()` does not return `ExtractorConfig`, to configure - extractor use `Route::with_async_config()` +- `Route::with_async()` does not return `ExtractorConfig`, to configure extractor use `Route::with_async_config()` # 0.6 - `Path` extractor return `ErrorNotFound` on failure instead of `ErrorBadRequest` -- `ws::Message::Close` now includes optional close reason. - `ws::CloseCode::Status` and `ws::CloseCode::Empty` have been removed. +- `ws::Message::Close` now includes optional close reason. `ws::CloseCode::Status` and `ws::CloseCode::Empty` have been removed. - `HttpServer::threads()` renamed to `HttpServer::workers()`. -- `HttpServer::start_ssl()` and `HttpServer::start_tls()` deprecated. - Use `HttpServer::bind_ssl()` and `HttpServer::bind_tls()` instead. +- `HttpServer::start_ssl()` and `HttpServer::start_tls()` deprecated. Use `HttpServer::bind_ssl()` and `HttpServer::bind_tls()` instead. -- `HttpRequest::extensions()` returns read only reference to the request's Extension - `HttpRequest::extensions_mut()` returns mutable reference. +- `HttpRequest::extensions()` returns read only reference to the request's Extension `HttpRequest::extensions_mut()` returns mutable reference. - Instead of @@ -146,8 +135,7 @@ fn main() { - `FromRequest::Result` has to implement `Into>` -- [`Responder::respond_to()`](https://actix.rs/actix-web/actix_web/trait.Responder.html#tymethod.respond_to) - is generic over `S` +- [`Responder::respond_to()`](https://actix.rs/actix-web/actix_web/trait.Responder.html#tymethod.respond_to) is generic over `S` - Use `Query` extractor instead of HttpRequest::query()`. @@ -163,23 +151,19 @@ or let q = Query::>::extract(req); ``` -- Websocket operations are implemented as `WsWriter` trait. - you need to use `use actix_web::ws::WsWriter` +- Websocket operations are implemented as `WsWriter` trait. you need to use `use actix_web::ws::WsWriter` # 0.5 -- `HttpResponseBuilder::body()`, `.finish()`, `.json()` - methods return `HttpResponse` instead of `Result` +- `HttpResponseBuilder::body()`, `.finish()`, `.json()` methods return `HttpResponse` instead of `Result` -- `actix_web::Method`, `actix_web::StatusCode`, `actix_web::Version` - moved to `actix_web::http` module +- `actix_web::Method`, `actix_web::StatusCode`, `actix_web::Version` moved to `actix_web::http` module - `actix_web::header` moved to `actix_web::http::header` - `NormalizePath` moved to `actix_web::http` module -- `HttpServer` moved to `actix_web::server`, added new `actix_web::server::new()` function, - shortcut for `actix_web::server::HttpServer::new()` +- `HttpServer` moved to `actix_web::server`, added new `actix_web::server::new()` function, shortcut for `actix_web::server::HttpServer::new()` - `DefaultHeaders` middleware does not use separate builder, all builder methods moved to type itself @@ -187,11 +171,9 @@ let q = Query::>::extract(req); - `CookieSessionBackendBuilder` removed, all methods moved to `CookieSessionBackend` type -- `actix_web::httpcodes` module is deprecated, `HttpResponse::Ok()`, `HttpResponse::Found()` and other `HttpResponse::XXX()` - functions should be used instead +- `actix_web::httpcodes` module is deprecated, `HttpResponse::Ok()`, `HttpResponse::Found()` and other `HttpResponse::XXX()` functions should be used instead -- `ClientRequestBuilder::body()` returns `Result<_, actix_web::Error>` - instead of `Result<_, http::Error>` +- `ClientRequestBuilder::body()` returns `Result<_, actix_web::Error>` instead of `Result<_, http::Error>` - `Application` renamed to a `App` diff --git a/actix-web/MIGRATION-1.0.md b/actix-web/MIGRATION-1.0.md index 94c6321ac..d72bb63b6 100644 --- a/actix-web/MIGRATION-1.0.md +++ b/actix-web/MIGRATION-1.0.md @@ -88,8 +88,7 @@ ) ``` -- Resource registration. 1.0 version uses generalized resource - registration via `.service()` method. +- Resource registration. 1.0 version uses generalized resource registration via `.service()` method. instead of @@ -97,9 +96,7 @@ App.new().resource("/welcome", |r| r.f(welcome)) ``` - use App's or Scope's `.service()` method. `.service()` method accepts - object that implements `HttpServiceFactory` trait. By default - actix-web provides `Resource` and `Scope` services. + use App's or Scope's `.service()` method. `.service()` method accepts object that implements `HttpServiceFactory` trait. By default actix-web provides `Resource` and `Scope` services. ```rust App.new().service( @@ -164,9 +161,7 @@ } ``` -- `.f()`, `.a()` and `.h()` handler registration methods have been removed. - Use `.to()` for handlers and `.to_async()` for async handlers. Handler function - must use extractors. +- `.f()`, `.a()` and `.h()` handler registration methods have been removed. Use `.to()` for handlers and `.to_async()` for async handlers. Handler function must use extractors. instead of @@ -210,9 +205,7 @@ } ``` -- `State` is now `Data`. You register Data during the App initialization process - and then access it from handlers either using a Data extractor or using - HttpRequest's api. +- `State` is now `Data`. You register Data during the App initialization process and then access it from handlers either using a Data extractor or using HttpRequest's api. instead of @@ -277,8 +270,7 @@ .route("/index.html", web::get().to(index)); ``` -- `HttpRequest::body()`, `HttpRequest::urlencoded()`, `HttpRequest::json()`, `HttpRequest::multipart()` - method have been removed. Use `Bytes`, `String`, `Form`, `Json`, `Multipart` extractors instead. +- `HttpRequest::body()`, `HttpRequest::urlencoded()`, `HttpRequest::json()`, `HttpRequest::multipart()` method have been removed. Use `Bytes`, `String`, `Form`, `Json`, `Multipart` extractors instead. instead of @@ -317,8 +309,7 @@ use `use actix_multipart::Multipart` -- Response compression is not enabled by default. - To enable, use `Compress` middleware, `App::new().wrap(Compress::default())`. +- Response compression is not enabled by default. To enable, use `Compress` middleware, `App::new().wrap(Compress::default())`. - Session middleware moved to actix-session crate diff --git a/actix-web/MIGRATION-2.0.md b/actix-web/MIGRATION-2.0.md index 3af5f6e1a..41e6104b9 100644 --- a/actix-web/MIGRATION-2.0.md +++ b/actix-web/MIGRATION-2.0.md @@ -1,21 +1,16 @@ # Migrating to 2.0.0 -- `HttpServer::start()` renamed to `HttpServer::run()`. It also possible to - `.await` on `run` method result, in that case it awaits server exit. +- `HttpServer::start()` renamed to `HttpServer::run()`. It also possible to `.await` on `run` method result, in that case it awaits server exit. -- `App::register_data()` renamed to `App::app_data()` and accepts any type `T: 'static`. - Stored data is available via `HttpRequest::app_data()` method at runtime. +- `App::register_data()` renamed to `App::app_data()` and accepts any type `T: 'static`. Stored data is available via `HttpRequest::app_data()` method at runtime. - Extractor configuration must be registered with `App::app_data()` instead of `App::data()` -- Sync handlers has been removed. `.to_async()` method has been renamed to `.to()` - replace `fn` with `async fn` to convert sync handler to async +- Sync handlers has been removed. `.to_async()` method has been renamed to `.to()` replace `fn` with `async fn` to convert sync handler to async -- `actix_http_test::TestServer` moved to `actix_web::test` module. To start - test server use `test::start()` or `test_start_with_config()` methods +- `actix_http_test::TestServer` moved to `actix_web::test` module. To start test server use `test::start()` or `test_start_with_config()` methods -- `ResponseError` trait has been refactored. `ResponseError::error_response()` renders - http response. +- `ResponseError` trait has been refactored. `ResponseError::error_response()` renders http response. - Feature `rust-tls` renamed to `rustls` diff --git a/actix-web/MIGRATION-3.0.md b/actix-web/MIGRATION-3.0.md index 54bcd58bd..89255e434 100644 --- a/actix-web/MIGRATION-3.0.md +++ b/actix-web/MIGRATION-3.0.md @@ -1,31 +1,23 @@ # Migrating to 3.0.0 -- The return type for `ServiceRequest::app_data::()` was changed from returning a `Data` to - simply a `T`. To access a `Data` use `ServiceRequest::app_data::>()`. +- The return type for `ServiceRequest::app_data::()` was changed from returning a `Data` to simply a `T`. To access a `Data` use `ServiceRequest::app_data::>()`. - Cookie handling has been offloaded to the `cookie` crate: - `USERINFO_ENCODE_SET` is no longer exposed. Percent-encoding is still supported; check docs. - Some types now require lifetime parameters. -- The time crate was updated to `v0.2`, a major breaking change to the time crate, which affects - any `actix-web` method previously expecting a time v0.1 input. +- The time crate was updated to `v0.2`, a major breaking change to the time crate, which affects any `actix-web` method previously expecting a time v0.1 input. -- Setting a cookie's SameSite property, explicitly, to `SameSite::None` will now - result in `SameSite=None` being sent with the response Set-Cookie header. - To create a cookie without a SameSite attribute, remove any calls setting same_site. +- Setting a cookie's SameSite property, explicitly, to `SameSite::None` will now result in `SameSite=None` being sent with the response Set-Cookie header. To create a cookie without a SameSite attribute, remove any calls setting same_site. -- actix-http support for Actors messages was moved to actix-http crate and is enabled - with feature `actors` +- actix-http support for Actors messages was moved to actix-http crate and is enabled with feature `actors` -- content_length function is removed from actix-http. - You can set Content-Length by normally setting the response body or calling no_chunking function. +- content_length function is removed from actix-http. You can set Content-Length by normally setting the response body or calling no_chunking function. -- `BodySize::Sized64` variant has been removed. `BodySize::Sized` now receives a - `u64` instead of a `usize`. +- `BodySize::Sized64` variant has been removed. `BodySize::Sized` now receives a `u64` instead of a `usize`. -- Code that was using `path.` to access a `web::Path<(A, B, C)>`s elements now needs to use - destructuring or `.into_inner()`. For example: +- Code that was using `path.` to access a `web::Path<(A, B, C)>`s elements now needs to use destructuring or `.into_inner()`. For example: ```rust // Previously: @@ -44,9 +36,7 @@ } ``` -- `middleware::NormalizePath` can now also be configured to trim trailing slashes instead of always keeping one. - It will need `middleware::normalize::TrailingSlash` when being constructed with `NormalizePath::new(...)`, - or for an easier migration you can replace `wrap(middleware::NormalizePath)` with `wrap(middleware::NormalizePath::new(TrailingSlash::MergeOnly))`. +- `middleware::NormalizePath` can now also be configured to trim trailing slashes instead of always keeping one. It will need `middleware::normalize::TrailingSlash` when being constructed with `NormalizePath::new(...)`, or for an easier migration you can replace `wrap(middleware::NormalizePath)` with `wrap(middleware::NormalizePath::new(TrailingSlash::MergeOnly))`. - `HttpServer::maxconn` is renamed to the more expressive `HttpServer::max_connections`. diff --git a/actix-web/MIGRATION-4.0.md b/actix-web/MIGRATION-4.0.md index fbeae0680..7b1cfc03b 100644 --- a/actix-web/MIGRATION-4.0.md +++ b/actix-web/MIGRATION-4.0.md @@ -31,7 +31,7 @@ Headings marked with :warning: are **breaking behavioral changes**. They will pr - [Returning `HttpResponse` synchronously](#returning-httpresponse-synchronously) - [`#[actix_web::main]` and `#[tokio::main]`](#actix_webmain-and-tokiomain) - [`web::block`](#webblock) -- +- ## MSRV diff --git a/actix-web/README.md b/actix-web/README.md index 20ca66fad..a92837c3b 100644 --- a/actix-web/README.md +++ b/actix-web/README.md @@ -5,16 +5,7 @@

-[![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.3.0)](https://docs.rs/actix-web/4.3.0) -![MSRV](https://img.shields.io/badge/rustc-1.59+-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.3.0/status.svg)](https://deps.rs/crate/actix-web/4.3.0) -
-[![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) -![downloads](https://img.shields.io/crates/d/actix-web.svg) -[![Chat on Discord](https://img.shields.io/discord/771444961383153695?label=chat&logo=discord)](https://discord.gg/NWpN5mmg3x) +[![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.3.0)](https://docs.rs/actix-web/4.3.0) ![MSRV](https://img.shields.io/badge/rustc-1.59+-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.3.0/status.svg)](https://deps.rs/crate/actix-web/4.3.0)
[![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) ![downloads](https://img.shields.io/crates/d/actix-web.svg) [![Chat on Discord](https://img.shields.io/discord/771444961383153695?label=chat&logo=discord)](https://discord.gg/NWpN5mmg3x)

diff --git a/actix-web/examples/uds.rs b/actix-web/examples/uds.rs index ba4b25a29..15e28ba1d 100644 --- a/actix-web/examples/uds.rs +++ b/actix-web/examples/uds.rs @@ -41,7 +41,7 @@ async fn main() -> std::io::Result<()> { ) .service(web::resource("/test1.html").to(|| async { "Test\r\n" })) }) - .bind_uds("/Users/fafhrd91/uds-test")? + .bind_uds("/Users/me/uds-test")? .workers(1) .run() .await diff --git a/actix-web/src/middleware/authors-guide.md b/actix-web/src/middleware/authors-guide.md index a8d1edea4..64bad15c2 100644 --- a/actix-web/src/middleware/authors-guide.md +++ b/actix-web/src/middleware/authors-guide.md @@ -13,4 +13,5 @@ ## When To (Not) Use Middleware ## Author's References + - `EitherBody` + when is middleware appropriate: https://discord.com/channels/771444961383153695/952016890723729428 diff --git a/awc/CHANGES.md b/awc/CHANGES.md index 6d313ea2f..ad5cd9996 100644 --- a/awc/CHANGES.md +++ b/awc/CHANGES.md @@ -1,27 +1,33 @@ # Changes ## Unreleased - 2023-xx-xx + ### Changed + - `client::Connect` is now public to allow tunneling connection with `client::Connector`. - ## 3.1.0 - 2023-01-21 + ### Changed + - Minimum supported Rust version (MSRV) is now 1.59 due to transitive `time` dependency. - ## 3.0.1 - 2022-08-25 + ### Changed + - Minimum supported Rust version (MSRV) is now 1.57 due to transitive `time` dependency. ### Fixed + - Fixed handling of redirection requests that begin with `//`. [#2840] [#2840]: https://github.com/actix/actix-web/pull/2840 - ## 3.0.0 - 2022-03-07 + ### Dependencies + - Updated `actix-*` to Tokio v1-based versions. [#1813] - Updated `bytes` to `1.0`. [#1813] - Updated `cookie` to `0.16`. [#2555] @@ -30,6 +36,7 @@ - Updated `tokio` to `1`. ### Added + - `trust-dns` crate feature to enable `trust-dns-resolver` as client DNS resolver; disabled by default. [#1969] - `cookies` crate feature; enabled by default. [#2619] - `compress-brotli` crate feature; enabled by default. [#2250] @@ -46,6 +53,7 @@ - `ClientBuilder::add_default_header()` (and deprecate `ClientBuilder::header()`). [#2510] ### Changed + - `client::Connector` type now only has one generic type for `actix_service::Service`. [#2063] - `client::error::ConnectError` Resolver variant contains `Box` type. [#1905] - `client::ConnectorConfig` default timeout changed to 5 seconds. [#1905] @@ -63,6 +71,7 @@ - Minimum supported Rust version (MSRV) is now 1.54. ### Fixed + - Send headers along with redirected requests. [#2310] - Improve `Client` instantiation efficiency when using `openssl` by only building connectors once. [#2503] - Remove unnecessary `Unpin` bounds on `*::send_stream`. [#2553] @@ -71,6 +80,7 @@ - `impl Stream` for `ClientResponse` no longer requires the body type be `Unpin`. [#2546] ### Removed + - `compress` crate feature. [#2250] - `ClientRequest::set`; use `ClientRequest::insert_header`. [#1869] - `ClientRequest::set_header`; use `ClientRequest::insert_header`. [#1869] @@ -80,10 +90,10 @@ - `ClientBuilder::default` function [#2008] ### Security + - `cookie` upgrade addresses [`RUSTSEC-2020-0071`]. [`RUSTSEC-2020-0071`]: https://rustsec.org/advisories/RUSTSEC-2020-0071.html - [#1813]: https://github.com/actix/actix-web/pull/1813 [#1869]: https://github.com/actix/actix-web/pull/1869 [#1905]: https://github.com/actix/actix-web/pull/1905 @@ -113,46 +123,48 @@ [#2553]: https://github.com/actix/actix-web/pull/2553 [#2555]: https://github.com/actix/actix-web/pull/2555 -
3.0.0 Pre-Releases ## 3.0.0-beta.21 - 2022-02-16 + - No significant changes since `3.0.0-beta.20`. - ## 3.0.0-beta.20 - 2022-01-31 + - No significant changes since `3.0.0-beta.19`. - ## 3.0.0-beta.19 - 2022-01-21 + - No significant changes since `3.0.0-beta.18`. - ## 3.0.0-beta.18 - 2022-01-04 + - Minimum supported Rust version (MSRV) is now 1.54. - ## 3.0.0-beta.17 - 2021-12-29 + ### Changed + - Update `cookie` dependency (re-exported) to `0.16`. [#2555] ### Security + - `cookie` upgrade addresses [`RUSTSEC-2020-0071`]. [#2555]: https://github.com/actix/actix-web/pull/2555 [`RUSTSEC-2020-0071`]: https://rustsec.org/advisories/RUSTSEC-2020-0071.html - ## 3.0.0-beta.16 - 2021-12-29 + - `*::send_json` and `*::send_form` methods now receive `impl Serialize`. [#2553] - `FrozenClientRequest::extra_header` now uses receives an `impl TryIntoHeaderPair`. [#2553] - Remove unnecessary `Unpin` bounds on `*::send_stream`. [#2553] [#2553]: https://github.com/actix/actix-web/pull/2553 - ## 3.0.0-beta.15 - 2021-12-27 + - Rename `Connector::{ssl => openssl}`. [#2503] - Improve `Client` instantiation efficiency when using `openssl` by only building connectors once. [#2503] - `ClientRequest::send_body` now takes an `impl MessageBody`. [#2546] @@ -164,89 +176,96 @@ [#2503]: https://github.com/actix/actix-web/pull/2503 [#2546]: https://github.com/actix/actix-web/pull/2546 - ## 3.0.0-beta.14 - 2021-12-17 + - Add `ClientBuilder::add_default_header` and deprecate `ClientBuilder::header`. [#2510] [#2510]: https://github.com/actix/actix-web/pull/2510 - ## 3.0.0-beta.13 - 2021-12-11 + - No significant changes since `3.0.0-beta.12`. - ## 3.0.0-beta.12 - 2021-11-30 + - Update `actix-tls` to `3.0.0-rc.1`. [#2474] [#2474]: https://github.com/actix/actix-web/pull/2474 - ## 3.0.0-beta.11 - 2021-11-22 + - No significant changes from `3.0.0-beta.10`. - ## 3.0.0-beta.10 - 2021-11-15 + - No significant changes from `3.0.0-beta.9`. - ## 3.0.0-beta.9 - 2021-10-20 + - Updated rustls to v0.20. [#2414] [#2414]: https://github.com/actix/actix-web/pull/2414 - ## 3.0.0-beta.8 - 2021-09-09 + ### Changed + - Send headers within the redirect requests. [#2310] [#2310]: https://github.com/actix/actix-web/pull/2310 - ## 3.0.0-beta.7 - 2021-06-26 + ### Changed + - Change compression algorithm features flags. [#2250] [#2250]: https://github.com/actix/actix-web/pull/2250 - ## 3.0.0-beta.6 - 2021-06-17 + - No significant changes since 3.0.0-beta.5. - ## 3.0.0-beta.5 - 2021-04-17 + ### Removed + - Deprecated methods on `ClientRequest`: `if_true`, `if_some`. [#2148] [#2148]: https://github.com/actix/actix-web/pull/2148 - ## 3.0.0-beta.4 - 2021-04-02 + ### Added + - Add `Client::headers` to get default mut reference of `HeaderMap` of client object. [#2114] ### Changed + - `ConnectorService` type is renamed to `BoxConnectorService`. [#2081] - Fix http/https encoding when enabling `compress` feature. [#2116] -- Rename `TestResponse::header` to `append_header`, `set` to `insert_header`. `TestResponse` header - methods now take `TryIntoHeaderPair` tuples. [#2094] +- Rename `TestResponse::header` to `append_header`, `set` to `insert_header`. `TestResponse` header methods now take `TryIntoHeaderPair` tuples. [#2094] [#2081]: https://github.com/actix/actix-web/pull/2081 [#2094]: https://github.com/actix/actix-web/pull/2094 [#2114]: https://github.com/actix/actix-web/pull/2114 [#2116]: https://github.com/actix/actix-web/pull/2116 - ## 3.0.0-beta.3 - 2021-03-08 + ### Added + - `ClientResponse::timeout` for set the timeout of collecting response body. [#1931] - `ClientBuilder::local_address` for bind to a local ip address for this client. [#2024] ### Changed + - Feature `cookies` is now optional and enabled by default. [#1981] - `ClientBuilder::connector` method would take `actix_http::client::Connector` type. [#2008] - Basic auth password now takes blank passwords as an empty string instead of Option. [#2050] ### Removed + - `ClientBuilder::default` function [#2008] [#1931]: https://github.com/actix/actix-web/pull/1931 @@ -255,17 +274,20 @@ [#2024]: https://github.com/actix/actix-web/pull/2024 [#2050]: https://github.com/actix/actix-web/pull/2050 - ## 3.0.0-beta.2 - 2021-02-10 + ### Added + - `ClientRequest::insert_header` method which allows using typed headers. [#1869] - `ClientRequest::append_header` method which allows using typed headers. [#1869] - `trust-dns` optional feature to enable `trust-dns-resolver` as client dns resolver. [#1969] ### Changed + - Relax default timeout for `Connector` to 5 seconds(original 1 second). [#1905] ### Removed + - `ClientRequest::set`; use `ClientRequest::insert_header`. [#1869] - `ClientRequest::set_header`; use `ClientRequest::insert_header`. [#1869] - `ClientRequest::set_header_if_none`; use `ClientRequest::insert_header_if_none`. [#1869] @@ -275,9 +297,10 @@ [#1905]: https://github.com/actix/actix-web/pull/1905 [#1969]: https://github.com/actix/actix-web/pull/1969 - ## 3.0.0-beta.1 - 2021-01-07 + ### Changed + - Update `rand` to `0.8` - Update `bytes` to `1.0`. [#1813] - Update `rust-tls` to `0.19`. [#1813] @@ -287,53 +310,62 @@
## 2.0.3 - 2020-11-29 + ### Fixed + - Ensure `actix-http` dependency uses same `serde_urlencoded`. - ## 2.0.2 - 2020-11-25 + ### Changed + - Upgrade `serde_urlencoded` to `0.7`. [#1773] [#1773]: https://github.com/actix/actix-web/pull/1773 - ## 2.0.1 - 2020-10-30 + ### Changed + - Upgrade `base64` to `0.13`. [#1744] - Deprecate `ClientRequest::{if_some, if_true}`. [#1760] ### Fixed -- Use `Accept-Encoding: identity` instead of `Accept-Encoding: br` when no compression feature - is enabled [#1737] + +- Use `Accept-Encoding: identity` instead of `Accept-Encoding: br` when no compression feature is enabled [#1737] [#1737]: https://github.com/actix/actix-web/pull/1737 [#1760]: https://github.com/actix/actix-web/pull/1760 [#1744]: https://github.com/actix/actix-web/pull/1744 - ## 2.0.0 - 2020-09-11 + ### Changed + - `Client::build` was renamed to `Client::builder`. - ## 2.0.0-beta.4 - 2020-09-09 + ### Changed + - Update actix-codec & actix-tls dependencies. - ## 2.0.0-beta.3 - 2020-08-17 + ### Changed + - Update `rustls` to 0.18 - ## 2.0.0-beta.2 - 2020-07-21 + ### Changed + - Update `actix-http` dependency to 2.0.0-beta.2 - ## [2.0.0-beta.1] - 2020-07-14 + ### Changed + - Update `actix-http` dependency to 2.0.0-beta.1 ## [2.0.0-alpha.2] - 2020-05-21 @@ -365,26 +397,22 @@ - Migrate to `std::future` - ## [0.2.8] - 2019-11-06 - Add support for setting query from Serialize type for client request. - ## [0.2.7] - 2019-09-25 ### Added - Remaining getter methods for `ClientRequest`'s private `head` field #1101 - ## [0.2.6] - 2019-09-12 ### Added - Export frozen request related types. - ## [0.2.5] - 2019-09-11 ### Added @@ -395,7 +423,6 @@ - Ensure that the `Host` header is set when initiating a WebSocket client connection. - ## [0.2.4] - 2019-08-13 ### Changed @@ -404,14 +431,12 @@ - Update serde_urlencoded to "0.6.1" - ## [0.2.3] - 2019-08-01 ### Added - Add `rustls` support - ## [0.2.2] - 2019-07-01 ### Changed @@ -420,7 +445,6 @@ - Upgrade `rand` dependency version to 0.7 - ## [0.2.1] - 2019-06-05 ### Added @@ -437,7 +461,6 @@ - Upgrade actix-http dependency. - ## [0.1.1] - 2019-04-19 ### Added @@ -448,19 +471,16 @@ - `ClientRequest::if_true()` and `ClientRequest::if_some()` use instance instead of ref - ## [0.1.0] - 2019-04-16 - No changes - ## [0.1.0-alpha.6] - 2019-04-14 ### Changed - Do not set default headers for websocket request - ## [0.1.0-alpha.5] - 2019-04-12 ### Changed @@ -471,14 +491,12 @@ - Add Debug impl for BoxedSocket - ## [0.1.0-alpha.4] - 2019-04-08 ### Changed - Update actix-http dependency - ## [0.1.0-alpha.3] - 2019-04-02 ### Added @@ -487,7 +505,6 @@ - `ClientResponse::json()` - Loads and parse `application/json` encoded body - ### Changed - `ClientRequest::json()` accepts reference instead of object. @@ -496,7 +513,6 @@ - Renamed `ClientRequest::close_connection()` to `ClientRequest::force_close()` - ## [0.1.0-alpha.2] - 2019-03-29 ### Added @@ -509,14 +525,12 @@ - Re-export `actix_http::client::Connector`. - ### Changed - Allow to override request's uri - Export `ws` sub-module with websockets related types - ## [0.1.0-alpha.1] - 2019-03-28 - Initial impl diff --git a/awc/README.md b/awc/README.md index cbe9af26a..99b845eac 100644 --- a/awc/README.md +++ b/awc/README.md @@ -12,7 +12,7 @@ - [API Documentation](https://docs.rs/awc) - [Example Project](https://github.com/actix/examples/tree/master/https-tls/awc-https) -- Minimum Supported Rust Version (MSRV): 1.54 +- Minimum Supported Rust Version (MSRV): 1.59 ## Example diff --git a/scripts/bump b/scripts/bump index 33ea52010..87fd50856 100755 --- a/scripts/bump +++ b/scripts/bump @@ -51,7 +51,6 @@ cat "$CHANGELOG_FILE" | if [ "$(wc -w "$CHANGE_CHUNK_FILE" | awk '{ print $1 }')" = "0" ]; then echo "- No significant changes since \`$CURRENT_VERSION\`." >"$CHANGE_CHUNK_FILE" echo >>"$CHANGE_CHUNK_FILE" - echo >>"$CHANGE_CHUNK_FILE" fi if [ -n "${2-}" ]; then @@ -82,14 +81,17 @@ sed -i.bak -E "s/^version ?= ?\"[^\"]+\"$/version = \"$NEW_VERSION\"/" "$CARGO_M ( sed '/Unreleased/ q' "$CHANGELOG_FILE" # up to unreleased heading echo # blank line - echo # blank line echo "## $NEW_VERSION - $DATE" # new version heading + echo # blank line cat "$CHANGE_CHUNK_FILE" # previously unreleased changes sed "/$CURRENT_VERSION/ q" "$CHANGELOG_FILE" | tail -n 1 # the previous version heading sed "1,/$CURRENT_VERSION/ d" "$CHANGELOG_FILE" # everything after previous version heading ) >"$CHANGELOG_FILE.bak" mv "$CHANGELOG_FILE.bak" "$CHANGELOG_FILE" +# format CHANGELOG file according to prettier +npx -y prettier --write "$CHANGELOG_FILE" || true + # done; remove backup files rm -f $CARGO_MANIFEST.bak rm -f $CHANGELOG_FILE.bak @@ -139,12 +141,14 @@ GIT_TAG="$(echo $SHORT_PACKAGE_NAME-v$NEW_VERSION)" RELEASE_TITLE="$(echo $PACKAGE_NAME: v$NEW_VERSION)" if [ "$(echo $NEW_VERSION | grep beta)" ] || [ "$(echo $NEW_VERSION | grep rc)" ] || [ "$(echo $NEW_VERSION | grep alpha)" ]; then - PRERELEASE="--prerelease" + FLAGS="--prerelease" +else + FLAGS="--latest" fi echo echo "GitHub release command:" -GH_CMD="gh release create \"$GIT_TAG\" --draft --title \"$RELEASE_TITLE\" --notes-file \"$CHANGE_CHUNK_FILE\" ${PRERELEASE:-}" +GH_CMD="gh release create \"$GIT_TAG\" --draft --title \"$RELEASE_TITLE\" --notes-file \"$CHANGE_CHUNK_FILE\" ${FLAGS:-}" echo "$GH_CMD" read -p "Submit draft GH release: (y/N) " GH_RELEASE