From 5d0e8138eeab63647e1e36001e6ae8e2a8ac3722 Mon Sep 17 00:00:00 2001
From: e-rhodes <33500135+e-rhodes@users.noreply.github.com>
Date: Wed, 22 Jun 2022 14:02:03 -0600
Subject: [PATCH 1/3] Add getters for `&ServiceRequest` (#2786)
---
actix-web/CHANGES.md | 3 +++
actix-web/src/service.rs | 12 ++++++++++++
2 files changed, 15 insertions(+)
diff --git a/actix-web/CHANGES.md b/actix-web/CHANGES.md
index fb27cddfd..3fa2f8f21 100644
--- a/actix-web/CHANGES.md
+++ b/actix-web/CHANGES.md
@@ -2,7 +2,10 @@
## Unreleased - 2022-xx-xx
- Minimum supported Rust version (MSRV) is now 1.57 due to transitive `time` dependency.
+### Added
+- Add `ServiceRequest::{parts, request}()` getter methods. [#2786]
+[#2786]: https://github.com/actix/actix-web/pull/2786
## 4.1.0 - 2022-06-11
### Added
diff --git a/actix-web/src/service.rs b/actix-web/src/service.rs
index a9e809bf9..0ad92d8a1 100644
--- a/actix-web/src/service.rs
+++ b/actix-web/src/service.rs
@@ -95,6 +95,18 @@ impl ServiceRequest {
(&mut self.req, &mut self.payload)
}
+ /// Returns immutable accessors to inner parts.
+ #[inline]
+ pub fn parts(&self) -> (&HttpRequest, &Payload) {
+ (&self.req, &self.payload)
+ }
+
+ /// Returns immutable accessor to inner [`HttpRequest`].
+ #[inline]
+ pub fn request(&self) -> &HttpRequest {
+ &self.req
+ }
+
/// Derives a type from this request using an [extractor](crate::FromRequest).
///
/// Returns the `T` extractor's `Future` type which can be `await`ed. This is particularly handy
From de92b3be2e6894c353816c6bd29d2a4768ccb92f Mon Sep 17 00:00:00 2001
From: oatoam <31235342+oatoam@users.noreply.github.com>
Date: Fri, 24 Jun 2022 11:46:17 +0800
Subject: [PATCH 2/3] fix unrecoverable Err(Overflow) in websocket frame parser
(#2790)
---
actix-http/CHANGES.md | 6 +++++
actix-http/src/ws/frame.rs | 49 +++++++++++++++++++++++++++-----------
2 files changed, 41 insertions(+), 14 deletions(-)
diff --git a/actix-http/CHANGES.md b/actix-http/CHANGES.md
index 209f86cad..dd6051b85 100644
--- a/actix-http/CHANGES.md
+++ b/actix-http/CHANGES.md
@@ -1,8 +1,14 @@
# Changes
## Unreleased - 2022-xx-xx
+### Fixed
+- Websocket parser no longer throws endless overflow errors after receiving an oversized frame. [#2790]
+
+### Changed
- Minimum supported Rust version (MSRV) is now 1.57 due to transitive `time` dependency.
+[#2790]: https://github.com/actix/actix-web/pull/2790
+
## 3.1.0 - 2022-06-11
### Changed
diff --git a/actix-http/src/ws/frame.rs b/actix-http/src/ws/frame.rs
index 17e34e2ba..3659b6c3b 100644
--- a/actix-http/src/ws/frame.rs
+++ b/actix-http/src/ws/frame.rs
@@ -17,7 +17,6 @@ impl Parser {
fn parse_metadata(
src: &[u8],
server: bool,
- max_size: usize,
) -> Result