"]
description = "Actix web is a powerful, pragmatic, and extremely fast web framework for Rust"
readme = "README.md"
diff --git a/README.md b/README.md
index b11a8ee7c..c1d857f81 100644
--- a/README.md
+++ b/README.md
@@ -6,10 +6,10 @@
[](https://crates.io/crates/actix-web)
-[](https://docs.rs/actix-web/3.2.0)
+[](https://docs.rs/actix-web/3.3.0)
[](https://blog.rust-lang.org/2020/03/12/Rust-1.42.html)

-[](https://deps.rs/crate/actix-web/3.2.0)
+[](https://deps.rs/crate/actix-web/3.3.0)
[](https://travis-ci.org/actix/actix-web)
[](https://codecov.io/gh/actix/actix-web)
diff --git a/awc/Cargo.toml b/awc/Cargo.toml
index d92996fb9..d5b632a51 100644
--- a/awc/Cargo.toml
+++ b/awc/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "awc"
-version = "2.0.1"
+version = "2.0.2"
authors = ["Nikolay Kim "]
description = "Async HTTP and WebSocket client library built on the Actix ecosystem"
readme = "README.md"
diff --git a/test-server/CHANGES.md b/test-server/CHANGES.md
index 845b6e2dc..835b75ddc 100644
--- a/test-server/CHANGES.md
+++ b/test-server/CHANGES.md
@@ -2,15 +2,20 @@
## Unreleased - 2020-xx-xx
-* add ability to set address for `TestServer` [#1645]
-* Upgrade `base64` to `0.13`.
-* Upgrade `serde_urlencoded` to `0.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]
+
+[#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
@@ -20,74 +25,56 @@
* Update `base64` dependency to 0.12
* Update `env_logger` dependency to 0.7
-## [1.0.0] - 2019-12-13
-
-### Changed
-
+## 1.0.0 - 2019-12-13
* Replaced `TestServer::start()` with `test_server()`
-## [1.0.0-alpha.3] - 2019-12-07
-
-### Changed
-
+## 1.0.0-alpha.3 - 2019-12-07
* Migrate to `std::future`
-## [0.2.5] - 2019-09-17
-
-### Changed
-
+## 0.2.5 - 2019-09-17
* Update serde_urlencoded to "0.6.1"
* Increase TestServerRuntime timeouts from 500ms to 3000ms
-
-### Fixed
-
* Do not override current `System`
-## [0.2.4] - 2019-07-18
-
+## 0.2.4 - 2019-07-18
* Update actix-server to 0.6
-## [0.2.3] - 2019-07-16
+## 0.2.3 - 2019-07-16
* Add `delete`, `options`, `patch` methods to `TestServerRunner`
-## [0.2.2] - 2019-06-16
+## 0.2.2 - 2019-06-16
* Add .put() and .sput() methods
-## [0.2.1] - 2019-06-05
+## 0.2.1 - 2019-06-05
* Add license files
-## [0.2.0] - 2019-05-12
+## 0.2.0 - 2019-05-12
* Update awc and actix-http deps
-## [0.1.1] - 2019-04-24
+## 0.1.1 - 2019-04-24
* Always make new connection for http client
-## [0.1.0] - 2019-04-16
-
+## 0.1.0 - 2019-04-16
* No changes
-## [0.1.0-alpha.3] - 2019-04-02
-
+## 0.1.0-alpha.3 - 2019-04-02
* Request functions accept path #743
-## [0.1.0-alpha.2] - 2019-03-29
-
+## 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
-
+## 0.1.0-alpha.1 - 2019-03-28
* Initial impl
diff --git a/test-server/Cargo.toml b/test-server/Cargo.toml
index 87db93469..8b23bef1c 100644
--- a/test-server/Cargo.toml
+++ b/test-server/Cargo.toml
@@ -1,8 +1,8 @@
[package]
name = "actix-http-test"
-version = "2.0.0"
+version = "2.1.0"
authors = ["Nikolay Kim "]
-description = "Actix HTTP test server"
+description = "Various helpers for Actix applications to use during testing"
readme = "README.md"
keywords = ["http", "web", "framework", "async", "futures"]
homepage = "https://actix.rs"
diff --git a/test-server/README.md b/test-server/README.md
index db0791db7..c847c8515 100644
--- a/test-server/README.md
+++ b/test-server/README.md
@@ -1,9 +1,15 @@
-# Actix http test server [](https://travis-ci.org/actix/actix-web) [](https://codecov.io/gh/actix/actix-web) [](https://crates.io/crates/actix-http-test) [](https://gitter.im/actix/actix?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+# actix-http-test
-## Documentation & community resources
+> Various helpers for Actix applications to use during testing.
-* [User Guide](https://actix.rs/docs/)
-* [API Documentation](https://docs.rs/actix-http-test/)
-* [Chat on gitter](https://gitter.im/actix/actix)
-* Cargo package: [actix-http-test](https://crates.io/crates/actix-http-test)
-* Minimum supported Rust version: 1.40 or later
+[](https://crates.io/crates/actix-http-test)
+[](https://docs.rs/actix-http-test/2.1.0)
+
+[](https://deps.rs/crate/actix-http-test/2.1.0)
+[](https://gitter.im/actix/actix-web?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+
+## Documentation & Resources
+
+- [API Documentation](https://docs.rs/actix-http-test)
+- [Chat on Gitter](https://gitter.im/actix/actix-web)
+- Minimum Supported Rust Version (MSRV): 1.42.0
diff --git a/test-server/src/lib.rs b/test-server/src/lib.rs
index 4159c8d86..f881dfb4c 100644
--- a/test-server/src/lib.rs
+++ b/test-server/src/lib.rs
@@ -1,4 +1,9 @@
//! Various helpers for Actix applications to use during testing.
+
+#![deny(rust_2018_idioms)]
+#![doc(html_logo_url = "https://actix.rs/img/logo.png")]
+#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]
+
use std::sync::mpsc;
use std::{net, thread, time};
From fe6ad816cc730e545cf27e26d68ba26ddc20afe6 Mon Sep 17 00:00:00 2001
From: Rob Ede
Date: Wed, 25 Nov 2020 00:54:00 +0000
Subject: [PATCH 27/81] update dotgraphs
---
docs/graphs/web-focus.dot | 42 ++++++++++++++++++++-------------------
docs/graphs/web-only.dot | 2 ++
2 files changed, 24 insertions(+), 20 deletions(-)
diff --git a/docs/graphs/web-focus.dot b/docs/graphs/web-focus.dot
index 7abd51268..bcae36616 100644
--- a/docs/graphs/web-focus.dot
+++ b/docs/graphs/web-focus.dot
@@ -2,29 +2,31 @@ digraph {
subgraph cluster_web {
label="actix/actix-web"
"awc"
- "actix-web"
- "actix-files"
- "actix-http"
- "actix-multipart"
- "actix-web-actors"
- "actix-web-codegen"
+ "web"
+ "files"
+ "http"
+ "multipart"
+ "web-actors"
+ "codegen"
+ "http-test"
}
- "actix-web" -> { "actix-codec" "actix-service" "actix-utils" "actix-router" "actix-rt" "actix-server" "actix-testing" "actix-macros" "actix-threadpool" "actix-tls" "actix-web-codegen" "actix-http" "awc" }
- "awc" -> { "actix-codec" "actix-service" "actix-http" "actix-rt" }
- "actix-web-actors" -> { "actix" "actix-web" "actix-http" "actix-codec" }
- "actix-multipart" -> { "actix-web" "actix-service" "actix-utils" }
- "actix-http" -> { "actix-service" "actix-codec" "actix-connect" "actix-utils" "actix-rt" "actix-threadpool" }
- "actix-http" -> { "actix" "actix-tls" }[color=blue] // optional
- "actix-files" -> { "actix-web" "actix-http" }
+ "web" -> { "codec" "service" "utils" "router" "rt" "server" "testing" "macros" "threadpool" "tls" "codegen" "http" "awc" }
+ "awc" -> { "codec" "service" "http" "rt" }
+ "web-actors" -> { "actix" "web" "http" "codec" }
+ "multipart" -> { "web" "service" "utils" }
+ "http" -> { "service" "codec" "connect" "utils" "rt" "threadpool" }
+ "http" -> { "actix" "tls" }[color=blue] // optional
+ "files" -> { "web" "http" }
+ "http-test" -> { "service" "codec" "connect" "utils" "rt" "server" "testing" "awc" }
// net
- "actix-utils" -> { "actix-service" "actix-rt" "actix-codec" }
- "actix-tracing" -> { "actix-service" }
- "actix-tls" -> { "actix-service" "actix-codec" "actix-utils" }
- "actix-testing" -> { "actix-rt" "actix-macros" "actix-server" "actix-service" }
- "actix-server" -> { "actix-service" "actix-rt" "actix-codec" "actix-utils" }
- "actix-rt" -> { "actix-macros" "actix-threadpool" }
- "actix-connect" -> { "actix-service" "actix-codec" "actix-utils" "actix-rt" }
+ "utils" -> { "service" "rt" "codec" }
+ "tracing" -> { "service" }
+ "tls" -> { "service" "codec" "utils" }
+ "testing" -> { "rt" "macros" "server" "service" }
+ "server" -> { "service" "rt" "codec" "utils" }
+ "rt" -> { "macros" "threadpool" }
+ "connect" -> { "service" "codec" "utils" "rt" }
}
diff --git a/docs/graphs/web-only.dot b/docs/graphs/web-only.dot
index 6e41fdc27..ee653e33b 100644
--- a/docs/graphs/web-only.dot
+++ b/docs/graphs/web-only.dot
@@ -8,6 +8,7 @@ digraph {
"actix-multipart"
"actix-web-actors"
"actix-web-codegen"
+ "actix-http-test"
}
"actix-web" -> { "actix-web-codegen" "actix-http" "awc" }
@@ -16,4 +17,5 @@ digraph {
"actix-multipart" -> { "actix-web" }
"actix-http" -> { "actix" }[color=blue] // optional
"actix-files" -> { "actix-web" "actix-http" }
+ "actix-http-test" -> { "awc" }
}
From 0b5b463cfa951d96ec6b0167964ef613b0d2b091 Mon Sep 17 00:00:00 2001
From: Rob Ede
Date: Sun, 29 Nov 2020 16:33:45 +0000
Subject: [PATCH 28/81] prepare web and awc releases
closes #1799
---
Cargo.toml | 10 +++++-----
README.md | 6 +++---
awc/Cargo.toml | 4 ++--
awc/README.md | 4 ++--
docs/graphs/web-focus.dot | 2 +-
docs/graphs/web-only.dot | 4 ++--
src/lib.rs | 2 +-
7 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/Cargo.toml b/Cargo.toml
index 3a3a92da9..bdd87184c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,8 +1,8 @@
[package]
name = "actix-web"
-version = "3.3.0"
+version = "3.3.1"
authors = ["Nikolay Kim "]
-description = "Actix web is a powerful, pragmatic, and extremely fast web framework for Rust"
+description = "Actix Web is a powerful, pragmatic, and extremely fast web framework for Rust"
readme = "README.md"
keywords = ["actix", "http", "web", "framework", "async"]
homepage = "https://actix.rs"
@@ -85,11 +85,11 @@ actix-threadpool = "0.3.1"
actix-tls = "2.0.0"
actix-web-codegen = "0.4.0"
-actix-http = "2.1.0"
-awc = { version = "2.0.0", default-features = false }
+actix-http = "2.2.0"
+awc = { version = "2.0.3", default-features = false }
bytes = "0.5.3"
-derive_more = "0.99.2"
+derive_more = "0.99.5"
encoding_rs = "0.8"
futures-channel = { version = "0.3.5", default-features = false }
futures-core = { version = "0.3.5", default-features = false }
diff --git a/README.md b/README.md
index c1d857f81..f67da03c1 100644
--- a/README.md
+++ b/README.md
@@ -1,15 +1,15 @@
Actix web
- Actix web is a powerful, pragmatic, and extremely fast web framework for Rust
+ Actix Web is a powerful, pragmatic, and extremely fast web framework for Rust
[](https://crates.io/crates/actix-web)
-[](https://docs.rs/actix-web/3.3.0)
+[](https://docs.rs/actix-web/3.3.1)
[](https://blog.rust-lang.org/2020/03/12/Rust-1.42.html)

-[](https://deps.rs/crate/actix-web/3.3.0)
+[](https://deps.rs/crate/actix-web/3.3.1)
[](https://travis-ci.org/actix/actix-web)
[](https://codecov.io/gh/actix/actix-web)
diff --git a/awc/Cargo.toml b/awc/Cargo.toml
index d5b632a51..3c1963d6b 100644
--- a/awc/Cargo.toml
+++ b/awc/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "awc"
-version = "2.0.2"
+version = "2.0.3"
authors = ["Nikolay Kim "]
description = "Async HTTP and WebSocket client library built on the Actix ecosystem"
readme = "README.md"
@@ -39,7 +39,7 @@ compress = ["actix-http/compress"]
[dependencies]
actix-codec = "0.3.0"
actix-service = "1.0.6"
-actix-http = "2.0.0"
+actix-http = "2.2.0"
actix-rt = "1.0.0"
base64 = "0.13"
diff --git a/awc/README.md b/awc/README.md
index d14dd82dd..b97d4fa00 100644
--- a/awc/README.md
+++ b/awc/README.md
@@ -3,9 +3,9 @@
> Async HTTP and WebSocket client library.
[](https://crates.io/crates/awc)
-[](https://docs.rs/awc/2.0.2)
+[](https://docs.rs/awc/2.0.3)

-[](https://deps.rs/crate/awc/2.0.2)
+[](https://deps.rs/crate/awc/2.0.3)
[](https://gitter.im/actix/actix-web?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
## Documentation & Resources
diff --git a/docs/graphs/web-focus.dot b/docs/graphs/web-focus.dot
index bcae36616..17228fe62 100644
--- a/docs/graphs/web-focus.dot
+++ b/docs/graphs/web-focus.dot
@@ -17,7 +17,7 @@ digraph {
"multipart" -> { "web" "service" "utils" }
"http" -> { "service" "codec" "connect" "utils" "rt" "threadpool" }
"http" -> { "actix" "tls" }[color=blue] // optional
- "files" -> { "web" "http" }
+ "files" -> { "web" }
"http-test" -> { "service" "codec" "connect" "utils" "rt" "server" "testing" "awc" }
// net
diff --git a/docs/graphs/web-only.dot b/docs/graphs/web-only.dot
index ee653e33b..9e1bb2805 100644
--- a/docs/graphs/web-only.dot
+++ b/docs/graphs/web-only.dot
@@ -11,11 +11,11 @@ digraph {
"actix-http-test"
}
- "actix-web" -> { "actix-web-codegen" "actix-http" "awc" }
+ "actix-web" -> { "actix-web-codegen" "actix-http" "awc" }
"awc" -> { "actix-http" }
"actix-web-actors" -> { "actix" "actix-web" "actix-http" }
"actix-multipart" -> { "actix-web" }
"actix-http" -> { "actix" }[color=blue] // optional
- "actix-files" -> { "actix-web" "actix-http" }
+ "actix-files" -> { "actix-web" }
"actix-http-test" -> { "awc" }
}
diff --git a/src/lib.rs b/src/lib.rs
index 13e02c098..a8fc50d83 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,4 +1,4 @@
-//! Actix web is a powerful, pragmatic, and extremely fast web framework for Rust.
+//! Actix Web is a powerful, pragmatic, and extremely fast web framework for Rust.
//!
//! ## Example
//!
From ea8bf361041b35aa281835540f1e8aba9679aceb Mon Sep 17 00:00:00 2001
From: Rob Ede
Date: Sun, 29 Nov 2020 16:35:35 +0000
Subject: [PATCH 29/81] update web and awc changelogs
---
CHANGES.md | 2 ++
awc/CHANGES.md | 2 ++
2 files changed, 4 insertions(+)
diff --git a/CHANGES.md b/CHANGES.md
index 1364d6a9b..f30049c9d 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -1,6 +1,8 @@
# Changes
## Unreleased - 2020-xx-xx
+### Fixed
+* Ensure `actix-http` dependency uses same `serde_urlencoded`.
## 3.3.0 - 2020-11-25
diff --git a/awc/CHANGES.md b/awc/CHANGES.md
index 3745079cd..dfd8e3704 100644
--- a/awc/CHANGES.md
+++ b/awc/CHANGES.md
@@ -1,6 +1,8 @@
# Changes
## Unreleased - 2020-xx-xx
+### Fixed
+* Ensure `actix-http` dependency uses same `serde_urlencoded`.
## 2.0.2 - 2020-11-25
From 32d59ca904bceaf7638a25c0ba367a9560dfc3b1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Linus=20F=C3=A4rnstrand?=
Date: Mon, 30 Nov 2020 20:18:02 +0100
Subject: [PATCH 30/81] Upgrade socket2 dependency (#1803)
Upgrades to a version not making invalid assumptions about
the memory layout of std::net::SocketAddr
---
Cargo.toml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Cargo.toml b/Cargo.toml
index bdd87184c..f8da9d90c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -97,7 +97,7 @@ futures-util = { version = "0.3.5", default-features = false }
fxhash = "0.2.1"
log = "0.4"
mime = "0.3"
-socket2 = "0.3"
+socket2 = "0.3.16"
pin-project = "1.0.0"
regex = "1.4"
serde = { version = "1.0", features = ["derive"] }
From 7981e0068a8d201e2f669772a0e81e5a73523688 Mon Sep 17 00:00:00 2001
From: Maciej Hirsz <1096222+maciejhirsz@users.noreply.github.com>
Date: Tue, 1 Dec 2020 02:22:15 +0100
Subject: [PATCH 31/81] Remove a panic in normalize middleware (#1762)
Co-authored-by: Yuki Okushi
---
CHANGES.md | 1 +
src/middleware/normalize.rs | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/CHANGES.md b/CHANGES.md
index f30049c9d..1175aa54a 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -3,6 +3,7 @@
## Unreleased - 2020-xx-xx
### Fixed
* Ensure `actix-http` dependency uses same `serde_urlencoded`.
+* Removed an occasional `unwrap` on `None` panic in `NormalizePathNormalization`.
## 3.3.0 - 2020-11-25
diff --git a/src/middleware/normalize.rs b/src/middleware/normalize.rs
index e0ecd90dc..ac8ad71d5 100644
--- a/src/middleware/normalize.rs
+++ b/src/middleware/normalize.rs
@@ -137,9 +137,9 @@ where
// so the change can not be deduced from the length comparison
if path != original_path {
let mut parts = head.uri.clone().into_parts();
- let pq = parts.path_and_query.as_ref().unwrap();
+ let query = parts.path_and_query.as_ref().and_then(|pq| pq.query());
- let path = if let Some(q) = pq.query() {
+ let path = if let Some(q) = query {
Bytes::from(format!("{}?{}", path, q))
} else {
Bytes::copy_from_slice(path.as_bytes())
From 1f70ef155d76c4b96e8b7fdc01d338bf6b9b2185 Mon Sep 17 00:00:00 2001
From: Joshua Parkin
Date: Tue, 1 Dec 2020 13:39:41 +0000
Subject: [PATCH 32/81] Fix match_pattern() returning None for scope with
resource of empty path (#1798)
* fix match_pattern function not returning pattern where scope has resource of path ""
* remove print in test
* make comparison on existing else if block
* add fix to changelog
---
CHANGES.md | 3 +++
src/request.rs | 36 ++++++++++++++++++++++++++++++++++++
src/rmap.rs | 2 +-
3 files changed, 40 insertions(+), 1 deletion(-)
diff --git a/CHANGES.md b/CHANGES.md
index 1175aa54a..edf4380fb 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -4,6 +4,9 @@
### Fixed
* Ensure `actix-http` dependency uses same `serde_urlencoded`.
* Removed an occasional `unwrap` on `None` panic in `NormalizePathNormalization`.
+* Fix match_pattern() returning None for scope with resource of empty path. [#1798]
+
+[#1798]: https://github.com/actix/actix-web/pull/1798
## 3.3.0 - 2020-11-25
diff --git a/src/request.rs b/src/request.rs
index a1b42f926..bd4bbbf58 100644
--- a/src/request.rs
+++ b/src/request.rs
@@ -675,4 +675,40 @@ mod tests {
let res = call_service(&mut srv, req).await;
assert_eq!(res.status(), StatusCode::OK);
}
+
+ #[actix_rt::test]
+ async fn extract_path_pattern_complex() {
+ let mut srv = init_service(
+ App::new()
+ .service(web::scope("/user").service(web::scope("/{id}").service(
+ web::resource("").to(move |req: HttpRequest| {
+ assert_eq!(req.match_pattern(), Some("/user/{id}".to_owned()));
+
+ HttpResponse::Ok().finish()
+ }),
+ )))
+ .service(web::resource("/").to(move |req: HttpRequest| {
+ assert_eq!(req.match_pattern(), Some("/".to_owned()));
+
+ HttpResponse::Ok().finish()
+ }))
+ .default_service(web::to(move |req: HttpRequest| {
+ assert!(req.match_pattern().is_none());
+ HttpResponse::Ok().finish()
+ })),
+ )
+ .await;
+
+ let req = TestRequest::get().uri("/user/test").to_request();
+ let res = call_service(&mut srv, req).await;
+ assert_eq!(res.status(), StatusCode::OK);
+
+ let req = TestRequest::get().uri("/").to_request();
+ let res = call_service(&mut srv, req).await;
+ assert_eq!(res.status(), StatusCode::OK);
+
+ let req = TestRequest::get().uri("/not-exist").to_request();
+ let res = call_service(&mut srv, req).await;
+ assert_eq!(res.status(), StatusCode::OK);
+ }
}
diff --git a/src/rmap.rs b/src/rmap.rs
index 05c1f3f15..6827a11b2 100644
--- a/src/rmap.rs
+++ b/src/rmap.rs
@@ -86,7 +86,7 @@ impl ResourceMap {
if let Some(plen) = pattern.is_prefix_match(path) {
return rmap.has_resource(&path[plen..]);
}
- } else if pattern.is_match(path) {
+ } else if pattern.is_match(path) || pattern.pattern() == "" && path == "/" {
return true;
}
}
From 24d525d9784c61b1956f14841e9c78395037b0d6 Mon Sep 17 00:00:00 2001
From: Rob Ede
Date: Tue, 1 Dec 2020 22:22:46 +0000
Subject: [PATCH 33/81] prepare web 3.3.2 release
---
CHANGES.md | 17 +++++++++++++----
Cargo.toml | 2 +-
README.md | 4 ++--
awc/CHANGES.md | 3 +++
4 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/CHANGES.md b/CHANGES.md
index edf4380fb..d9984224f 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -1,12 +1,21 @@
# Changes
## Unreleased - 2020-xx-xx
-### Fixed
-* Ensure `actix-http` dependency uses same `serde_urlencoded`.
-* Removed an occasional `unwrap` on `None` panic in `NormalizePathNormalization`.
-* Fix match_pattern() returning None for scope with resource of empty path. [#1798]
+
+## 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]
+
+[#1762]: https://github.com/actix/actix-web/pull/1762
[#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
diff --git a/Cargo.toml b/Cargo.toml
index f8da9d90c..a7b571123 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "actix-web"
-version = "3.3.1"
+version = "3.3.2"
authors = ["Nikolay Kim "]
description = "Actix Web is a powerful, pragmatic, and extremely fast web framework for Rust"
readme = "README.md"
diff --git a/README.md b/README.md
index f67da03c1..b9f2b7594 100644
--- a/README.md
+++ b/README.md
@@ -6,10 +6,10 @@
[](https://crates.io/crates/actix-web)
-[](https://docs.rs/actix-web/3.3.1)
+[](https://docs.rs/actix-web/3.3.2)
[](https://blog.rust-lang.org/2020/03/12/Rust-1.42.html)

-[](https://deps.rs/crate/actix-web/3.3.1)
+[](https://deps.rs/crate/actix-web/3.3.2)
[](https://travis-ci.org/actix/actix-web)
[](https://codecov.io/gh/actix/actix-web)
diff --git a/awc/CHANGES.md b/awc/CHANGES.md
index dfd8e3704..7ca415336 100644
--- a/awc/CHANGES.md
+++ b/awc/CHANGES.md
@@ -1,6 +1,9 @@
# Changes
## Unreleased - 2020-xx-xx
+
+
+## 2.0.3 - 2020-11-29
### Fixed
* Ensure `actix-http` dependency uses same `serde_urlencoded`.
From d0c6ca7671d8e77a78432cf38cb4fb570f582f39 Mon Sep 17 00:00:00 2001
From: Arniu Tseng
Date: Thu, 3 Dec 2020 01:23:30 +0800
Subject: [PATCH 34/81] test-server => actix-http-test (#1807)
---
Cargo.toml | 6 +++---
{test-server => actix-http-test}/CHANGES.md | 0
{test-server => actix-http-test}/Cargo.toml | 0
{test-server => actix-http-test}/LICENSE-APACHE | 0
{test-server => actix-http-test}/LICENSE-MIT | 0
{test-server => actix-http-test}/README.md | 0
{test-server => actix-http-test}/src/lib.rs | 0
7 files changed, 3 insertions(+), 3 deletions(-)
rename {test-server => actix-http-test}/CHANGES.md (100%)
rename {test-server => actix-http-test}/Cargo.toml (100%)
rename {test-server => actix-http-test}/LICENSE-APACHE (100%)
rename {test-server => actix-http-test}/LICENSE-MIT (100%)
rename {test-server => actix-http-test}/README.md (100%)
rename {test-server => actix-http-test}/src/lib.rs (100%)
diff --git a/Cargo.toml b/Cargo.toml
index a7b571123..31c4cca7e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -34,7 +34,7 @@ members = [
"actix-multipart",
"actix-web-actors",
"actix-web-codegen",
- "test-server",
+ "actix-http-test",
]
[features]
@@ -127,10 +127,10 @@ codegen-units = 1
[patch.crates-io]
actix-web = { path = "." }
actix-http = { path = "actix-http" }
-actix-http-test = { path = "test-server" }
+actix-http-test = { path = "actix-http-test" }
actix-web-codegen = { path = "actix-web-codegen" }
-actix-files = { path = "actix-files" }
actix-multipart = { path = "actix-multipart" }
+actix-files = { path = "actix-files" }
awc = { path = "awc" }
[[bench]]
diff --git a/test-server/CHANGES.md b/actix-http-test/CHANGES.md
similarity index 100%
rename from test-server/CHANGES.md
rename to actix-http-test/CHANGES.md
diff --git a/test-server/Cargo.toml b/actix-http-test/Cargo.toml
similarity index 100%
rename from test-server/Cargo.toml
rename to actix-http-test/Cargo.toml
diff --git a/test-server/LICENSE-APACHE b/actix-http-test/LICENSE-APACHE
similarity index 100%
rename from test-server/LICENSE-APACHE
rename to actix-http-test/LICENSE-APACHE
diff --git a/test-server/LICENSE-MIT b/actix-http-test/LICENSE-MIT
similarity index 100%
rename from test-server/LICENSE-MIT
rename to actix-http-test/LICENSE-MIT
diff --git a/test-server/README.md b/actix-http-test/README.md
similarity index 100%
rename from test-server/README.md
rename to actix-http-test/README.md
diff --git a/test-server/src/lib.rs b/actix-http-test/src/lib.rs
similarity index 100%
rename from test-server/src/lib.rs
rename to actix-http-test/src/lib.rs
From b75a9b7a20b8cdc24842d38c7aa406e2b49f90c7 Mon Sep 17 00:00:00 2001
From: Petar Dambovaliev
Date: Fri, 4 Dec 2020 20:57:56 +0100
Subject: [PATCH 35/81] add error to message in test helper func (#1812)
---
CHANGES.md | 5 +++++
src/test.rs | 5 +++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/CHANGES.md b/CHANGES.md
index d9984224f..87c021b1e 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -1,6 +1,11 @@
# Changes
## Unreleased - 2020-xx-xx
+### Fixed
+* added the actual parsing error to `test::read_body_json` [#1812]
+
+[#1812]: https://github.com/actix/actix-web/pull/1812
+
## 3.3.2 - 2020-12-01
diff --git a/src/test.rs b/src/test.rs
index ee51b71ee..cff6c3e51 100644
--- a/src/test.rs
+++ b/src/test.rs
@@ -269,8 +269,9 @@ where
{
let body = read_body(res).await;
- serde_json::from_slice(&body)
- .unwrap_or_else(|_| panic!("read_response_json failed during deserialization"))
+ serde_json::from_slice(&body).unwrap_or_else(|e| {
+ panic!("read_response_json failed during deserialization: {}", e)
+ })
}
pub async fn load_stream(mut stream: S) -> Result
From ff79c33fd41ce9511e0bfb4835c688a2d5ac2a5d Mon Sep 17 00:00:00 2001
From: fakeshadow <24548779@qq.com>
Date: Sun, 6 Dec 2020 19:42:15 +0800
Subject: [PATCH 36/81] remove a box (#1814)
---
src/route.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/route.rs b/src/route.rs
index e9e9d1f5d..8cc1edfc2 100644
--- a/src/route.rs
+++ b/src/route.rs
@@ -135,7 +135,7 @@ impl Service for RouteService {
}
fn call(&mut self, req: ServiceRequest) -> Self::Future {
- self.service.call(req).boxed_local()
+ self.service.call(req)
}
}
From 7a3776b770405c13eeb0dd5bf95f9c545910b53a Mon Sep 17 00:00:00 2001
From: fakeshadow <24548779@qq.com>
Date: Wed, 9 Dec 2020 18:47:59 +0800
Subject: [PATCH 37/81] remove two unused generics on BoxedRouteFuture types.
(#1820)
---
src/route.rs | 42 +++++++++++++++++-------------------------
1 file changed, 17 insertions(+), 25 deletions(-)
diff --git a/src/route.rs b/src/route.rs
index 8cc1edfc2..45efd9e3c 100644
--- a/src/route.rs
+++ b/src/route.rs
@@ -16,24 +16,24 @@ use crate::responder::Responder;
use crate::service::{ServiceRequest, ServiceResponse};
use crate::HttpResponse;
-type BoxedRouteService = Box<
+type BoxedRouteService = Box<
dyn Service<
- Request = Req,
- Response = Res,
+ Request = ServiceRequest,
+ Response = ServiceResponse,
Error = Error,
- Future = LocalBoxFuture<'static, Result>,
+ Future = LocalBoxFuture<'static, Result>,
>,
>;
-type BoxedRouteNewService = Box<
+type BoxedRouteNewService = Box<
dyn ServiceFactory<
Config = (),
- Request = Req,
- Response = Res,
+ Request = ServiceRequest,
+ Response = ServiceResponse,
Error = Error,
InitError = (),
- Service = BoxedRouteService,
- Future = LocalBoxFuture<'static, Result, ()>>,
+ Service = BoxedRouteService,
+ Future = LocalBoxFuture<'static, Result>,
>,
>;
@@ -42,7 +42,7 @@ type BoxedRouteNewService = Box<
/// Route uses builder-like pattern for configuration.
/// If handler is not explicitly set, default *404 Not Found* handler is used.
pub struct Route {
- service: BoxedRouteNewService,
+ service: BoxedRouteNewService,
guards: Rc>>,
}
@@ -80,15 +80,8 @@ impl ServiceFactory for Route {
}
}
-type RouteFuture = LocalBoxFuture<
- 'static,
- Result, ()>,
->;
-
-#[pin_project::pin_project]
pub struct CreateRouteService {
- #[pin]
- fut: RouteFuture,
+ fut: LocalBoxFuture<'static, Result>,
guards: Rc>>,
}
@@ -96,9 +89,9 @@ impl Future for CreateRouteService {
type Output = Result;
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll {
- let this = self.project();
+ let this = self.get_mut();
- match this.fut.poll(cx)? {
+ match this.fut.as_mut().poll(cx)? {
Poll::Ready(service) => Poll::Ready(Ok(RouteService {
service,
guards: this.guards.clone(),
@@ -109,7 +102,7 @@ impl Future for CreateRouteService {
}
pub struct RouteService {
- service: BoxedRouteService,
+ service: BoxedRouteService,
guards: Rc>>,
}
@@ -275,12 +268,12 @@ where
T::Service: 'static,
::Future: 'static,
{
- type Config = ();
type Request = ServiceRequest;
type Response = ServiceResponse;
type Error = Error;
+ type Config = ();
+ type Service = BoxedRouteService;
type InitError = ();
- type Service = BoxedRouteService;
type Future = LocalBoxFuture<'static, Result>;
fn new_service(&self, _: ()) -> Self::Future {
@@ -288,8 +281,7 @@ where
.new_service(())
.map(|result| match result {
Ok(service) => {
- let service: BoxedRouteService<_, _> =
- Box::new(RouteServiceWrapper { service });
+ let service = Box::new(RouteServiceWrapper { service }) as _;
Ok(service)
}
Err(_) => Err(()),
From ae63eb8bb2576eeda9d261a358b954c3cd002fb3 Mon Sep 17 00:00:00 2001
From: Rob Ede
Date: Wed, 9 Dec 2020 11:22:19 +0000
Subject: [PATCH 38/81] fix clippy warnings (#1806)
* fix clippy warnings
* prevent CI fail status caused by codecov
---
actix-http/src/header/common/content_disposition.rs | 3 +--
actix-http/src/header/shared/entity.rs | 8 +++++---
awc/src/ws.rs | 11 ++++++++---
codecov.yml | 11 ++++++++++-
src/middleware/compress.rs | 5 +----
src/middleware/condition.rs | 1 +
src/middleware/errhandlers.rs | 1 +
src/types/payload.rs | 7 ++++---
8 files changed, 31 insertions(+), 16 deletions(-)
diff --git a/actix-http/src/header/common/content_disposition.rs b/actix-http/src/header/common/content_disposition.rs
index 37da830ca..826cfef63 100644
--- a/actix-http/src/header/common/content_disposition.rs
+++ b/actix-http/src/header/common/content_disposition.rs
@@ -550,8 +550,7 @@ impl fmt::Display for ContentDisposition {
write!(f, "{}", self.disposition)?;
self.parameters
.iter()
- .map(|param| write!(f, "; {}", param))
- .collect()
+ .try_for_each(|param| write!(f, "; {}", param))
}
}
diff --git a/actix-http/src/header/shared/entity.rs b/actix-http/src/header/shared/entity.rs
index 3525a19c6..344cfb864 100644
--- a/actix-http/src/header/shared/entity.rs
+++ b/actix-http/src/header/shared/entity.rs
@@ -7,10 +7,12 @@ use crate::header::{HeaderValue, IntoHeaderValue, InvalidHeaderValue, Writer};
/// 1. `%x21`, or
/// 2. in the range `%x23` to `%x7E`, or
/// 3. above `%x80`
+fn entity_validate_char(c: u8) -> bool {
+ c == 0x21 || (0x23..=0x7e).contains(&c) || (c >= 0x80)
+}
+
fn check_slice_validity(slice: &str) -> bool {
- slice
- .bytes()
- .all(|c| c == b'\x21' || (c >= b'\x23' && c <= b'\x7e') | (c >= b'\x80'))
+ slice.bytes().all(entity_validate_char)
}
/// An entity tag, defined in [RFC7232](https://tools.ietf.org/html/rfc7232#section-2.3)
diff --git a/awc/src/ws.rs b/awc/src/ws.rs
index 57e80bd46..aa474697b 100644
--- a/awc/src/ws.rs
+++ b/awc/src/ws.rs
@@ -70,9 +70,14 @@ impl WebsocketsRequest {
>::Error: Into,
{
let mut err = None;
- let mut head = RequestHead::default();
- head.method = Method::GET;
- head.version = Version::HTTP_11;
+
+ #[allow(clippy::field_reassign_with_default)]
+ let mut head = {
+ let mut head = RequestHead::default();
+ head.method = Method::GET;
+ head.version = Version::HTTP_11;
+ head
+ };
match Uri::try_from(uri) {
Ok(uri) => head.uri = uri,
diff --git a/codecov.yml b/codecov.yml
index 90cdfab47..102e8969d 100644
--- a/codecov.yml
+++ b/codecov.yml
@@ -1,4 +1,13 @@
-ignore: # ignore codecoverage on following paths
+coverage:
+ status:
+ project:
+ default:
+ threshold: 10% # make CI green
+ patch:
+ default:
+ threshold: 10% # make CI green
+
+ignore: # ignore code coverage on following paths
- "**/tests"
- "test-server"
- "**/benches"
diff --git a/src/middleware/compress.rs b/src/middleware/compress.rs
index fe3ba841c..7575d7455 100644
--- a/src/middleware/compress.rs
+++ b/src/middleware/compress.rs
@@ -192,10 +192,7 @@ impl AcceptEncoding {
};
let quality = match parts.len() {
1 => encoding.quality(),
- _ => match f64::from_str(parts[1]) {
- Ok(q) => q,
- Err(_) => 0.0,
- },
+ _ => f64::from_str(parts[1]).unwrap_or(0.0),
};
Some(AcceptEncoding { encoding, quality })
}
diff --git a/src/middleware/condition.rs b/src/middleware/condition.rs
index ab1c69746..9061c7458 100644
--- a/src/middleware/condition.rs
+++ b/src/middleware/condition.rs
@@ -105,6 +105,7 @@ mod tests {
use crate::test::{self, TestRequest};
use crate::HttpResponse;
+ #[allow(clippy::unnecessary_wraps)]
fn render_500(mut res: ServiceResponse) -> Result> {
res.response_mut()
.headers_mut()
diff --git a/src/middleware/errhandlers.rs b/src/middleware/errhandlers.rs
index 93a5d3f22..c0cb9594e 100644
--- a/src/middleware/errhandlers.rs
+++ b/src/middleware/errhandlers.rs
@@ -154,6 +154,7 @@ mod tests {
use crate::test::{self, TestRequest};
use crate::HttpResponse;
+ #[allow(clippy::unnecessary_wraps)]
fn render_500(mut res: ServiceResponse) -> Result> {
res.response_mut()
.headers_mut()
diff --git a/src/types/payload.rs b/src/types/payload.rs
index 4ff5ef4b4..fdc1f8c8a 100644
--- a/src/types/payload.rs
+++ b/src/types/payload.rs
@@ -241,9 +241,10 @@ pub struct PayloadConfig {
impl PayloadConfig {
/// Create `PayloadConfig` instance and set max size of payload.
pub fn new(limit: usize) -> Self {
- let mut cfg = Self::default();
- cfg.limit = limit;
- cfg
+ Self {
+ limit,
+ ..Default::default()
+ }
}
/// Change max size of payload. By default max size is 256Kb
From 542db82282ab0455a28bd006d147c5510035f634 Mon Sep 17 00:00:00 2001
From: Juan Aguilar
Date: Sat, 12 Dec 2020 21:07:06 +0100
Subject: [PATCH 39/81] Simplify wake up of task (#1826)
---
actix-http/src/h1/payload.rs | 4 +---
actix-multipart/src/server.rs | 4 +---
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/actix-http/src/h1/payload.rs b/actix-http/src/h1/payload.rs
index 6a348810c..d4cfee146 100644
--- a/actix-http/src/h1/payload.rs
+++ b/actix-http/src/h1/payload.rs
@@ -182,9 +182,7 @@ impl Inner {
self.len += data.len();
self.items.push_back(data);
self.need_read = self.len < MAX_BUFFER_SIZE;
- if let Some(task) = self.task.take() {
- task.wake()
- }
+ self.task.wake();
}
#[cfg(test)]
diff --git a/actix-multipart/src/server.rs b/actix-multipart/src/server.rs
index b9ebf97cc..b476f1791 100644
--- a/actix-multipart/src/server.rs
+++ b/actix-multipart/src/server.rs
@@ -725,9 +725,7 @@ impl Drop for Safety {
if Rc::strong_count(&self.payload) != self.level {
self.clean.set(true);
}
- if let Some(task) = self.task.take() {
- task.wake()
- }
+ self.task.wake();
}
}
From fabc68659bee4f9a04e8c0ac59a0e20c4e3804c1 Mon Sep 17 00:00:00 2001
From: Aravinth Manivannan
Date: Sun, 13 Dec 2020 18:58:39 +0530
Subject: [PATCH 40/81] Intradoc links conversion (#1827)
* switching to nightly for intra-doc links
* actix-files intra-doc conversion
* more specific Result
* intradoc conversion complete
* rm blank comments and readme doc link fixes
* macros and broken links
---
actix-http-test/src/lib.rs | 2 +-
actix-http/src/error.rs | 2 +-
actix-http/src/header/common/mod.rs | 2 +-
actix-http/src/header/map.rs | 4 ----
actix-web-codegen/README.md | 2 +-
actix-web-codegen/src/lib.rs | 24 +++++++++++-------------
awc/src/ws.rs | 2 +-
src/config.rs | 2 +-
src/info.rs | 2 +-
src/lib.rs | 8 ++++----
src/middleware/logger.rs | 3 +--
src/server.rs | 2 +-
src/service.rs | 6 +++---
src/types/form.rs | 2 +-
src/types/json.rs | 6 +++---
src/types/path.rs | 2 +-
src/types/payload.rs | 4 ++--
src/types/query.rs | 2 +-
18 files changed, 35 insertions(+), 42 deletions(-)
diff --git a/actix-http-test/src/lib.rs b/actix-http-test/src/lib.rs
index f881dfb4c..3ab3f8a0d 100644
--- a/actix-http-test/src/lib.rs
+++ b/actix-http-test/src/lib.rs
@@ -53,7 +53,7 @@ pub async fn test_server>(factory: F) -> TestServer
test_server_with_addr(tcp, factory).await
}
-/// Start [`test server`](./fn.test_server.html) on a concrete Address
+/// Start [`test server`](test_server()) on a concrete Address
pub async fn test_server_with_addr>(
tcp: net::TcpListener,
factory: F,
diff --git a/actix-http/src/error.rs b/actix-http/src/error.rs
index e93c077af..0ebd4c05c 100644
--- a/actix-http/src/error.rs
+++ b/actix-http/src/error.rs
@@ -25,7 +25,7 @@ pub use crate::cookie::ParseError as CookieParseError;
use crate::helpers::Writer;
use crate::response::{Response, ResponseBuilder};
-/// A specialized [`Result`](https://doc.rust-lang.org/std/result/enum.Result.html)
+/// A specialized [`std::result::Result`]
/// for actix web operations
///
/// This typedef is generally used to avoid writing out
diff --git a/actix-http/src/header/common/mod.rs b/actix-http/src/header/common/mod.rs
index 83489b864..c3d18613c 100644
--- a/actix-http/src/header/common/mod.rs
+++ b/actix-http/src/header/common/mod.rs
@@ -3,7 +3,7 @@
//! ## Mime
//!
//! Several header fields use MIME values for their contents. Keeping with the
-//! strongly-typed theme, the [mime](https://docs.rs/mime) crate
+//! strongly-typed theme, the [mime] crate
//! is used, such as `ContentType(pub Mime)`.
#![cfg_attr(rustfmt, rustfmt_skip)]
diff --git a/actix-http/src/header/map.rs b/actix-http/src/header/map.rs
index 36c050b8f..6ab3509f7 100644
--- a/actix-http/src/header/map.rs
+++ b/actix-http/src/header/map.rs
@@ -8,8 +8,6 @@ use http::header::{HeaderName, HeaderValue};
/// A set of HTTP headers
///
/// `HeaderMap` is an multi-map of [`HeaderName`] to values.
-///
-/// [`HeaderName`]: struct.HeaderName.html
#[derive(Debug, Clone)]
pub struct HeaderMap {
pub(crate) inner: FxHashMap,
@@ -141,8 +139,6 @@ impl HeaderMap {
/// The returned view does not incur any allocations and allows iterating
/// the values associated with the key. See [`GetAll`] for more details.
/// Returns `None` if there are no values associated with the key.
- ///
- /// [`GetAll`]: struct.GetAll.html
pub fn get_all(&self, name: N) -> GetAll<'_> {
GetAll {
idx: 0,
diff --git a/actix-web-codegen/README.md b/actix-web-codegen/README.md
index 6eca847b8..283591e86 100644
--- a/actix-web-codegen/README.md
+++ b/actix-web-codegen/README.md
@@ -3,7 +3,7 @@
> Helper and convenience macros for Actix Web
[](https://crates.io/crates/actix-web-codegen)
-[](https://docs.rs/actix-web)
+[](https://docs.rs/actix-web-codegen/0.4.0/actix_web_codegen/)
[](https://blog.rust-lang.org/2020/03/12/Rust-1.42.html)
[](https://travis-ci.org/actix/actix-web)
[](https://codecov.io/gh/actix/actix-web)
diff --git a/actix-web-codegen/src/lib.rs b/actix-web-codegen/src/lib.rs
index af2bc7f18..50e5be712 100644
--- a/actix-web-codegen/src/lib.rs
+++ b/actix-web-codegen/src/lib.rs
@@ -8,7 +8,7 @@
//! are re-exported.
//!
//! # Runtime Setup
-//! Used for setting up the actix async runtime. See [main] macro docs.
+//! Used for setting up the actix async runtime. See [macro@main] macro docs.
//!
//! ```rust
//! #[actix_web_codegen::main] // or `#[actix_web::main]` in Actix Web apps
@@ -34,7 +34,7 @@
//!
//! # Multiple Method Handlers
//! Similar to the single method handler macro but takes one or more arguments for the HTTP methods
-//! it should respond to. See [route] macro docs.
+//! it should respond to. See [macro@route] macro docs.
//!
//! ```rust
//! # use actix_web::HttpResponse;
@@ -46,17 +46,15 @@
//! ```
//!
//! [actix-web attributes docs]: https://docs.rs/actix-web/*/actix_web/#attributes
-//! [main]: attr.main.html
-//! [route]: attr.route.html
-//! [GET]: attr.get.html
-//! [POST]: attr.post.html
-//! [PUT]: attr.put.html
-//! [DELETE]: attr.delete.html
-//! [HEAD]: attr.head.html
-//! [CONNECT]: attr.connect.html
-//! [OPTIONS]: attr.options.html
-//! [TRACE]: attr.trace.html
-//! [PATCH]: attr.patch.html
+//! [GET]: macro@get
+//! [POST]: macro@post
+//! [PUT]: macro@put
+//! [HEAD]: macro@head
+//! [CONNECT]: macro@macro@connect
+//! [OPTIONS]: macro@options
+//! [TRACE]: macro@trace
+//! [PATCH]: macro@patch
+//! [DELETE]: macro@delete
#![recursion_limit = "512"]
diff --git a/awc/src/ws.rs b/awc/src/ws.rs
index aa474697b..dd43d08b3 100644
--- a/awc/src/ws.rs
+++ b/awc/src/ws.rs
@@ -1,6 +1,6 @@
//! Websockets client
//!
-//! Type definitions required to use [`awc::Client`](../struct.Client.html) as a WebSocket client.
+//! Type definitions required to use [`awc::Client`](super::Client) as a WebSocket client.
//!
//! # Example
//!
diff --git a/src/config.rs b/src/config.rs
index 03ba82732..01959daa1 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -141,7 +141,7 @@ impl AppConfig {
/// Server host name.
///
/// Host name is used by application router as a hostname for url generation.
- /// Check [ConnectionInfo](./struct.ConnectionInfo.html#method.host)
+ /// Check [ConnectionInfo](super::dev::ConnectionInfo::host())
/// documentation for more information.
///
/// By default host name is set to a "localhost" value.
diff --git a/src/info.rs b/src/info.rs
index 1d9b402a7..975604041 100644
--- a/src/info.rs
+++ b/src/info.rs
@@ -174,7 +174,7 @@ impl ConnectionInfo {
/// Do not use this function for security purposes, unless you can ensure the Forwarded and
/// X-Forwarded-For headers cannot be spoofed by the client. If you want the client's socket
/// address explicitly, use
- /// [`HttpRequest::peer_addr()`](../web/struct.HttpRequest.html#method.peer_addr) instead.
+ /// [`HttpRequest::peer_addr()`](super::web::HttpRequest::peer_addr()) instead.
#[inline]
pub fn realip_remote_addr(&self) -> Option<&str> {
if let Some(ref r) = self.realip_remote_addr {
diff --git a/src/lib.rs b/src/lib.rs
index a8fc50d83..b8346d966 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -29,16 +29,16 @@
//!
//! To get started navigating the API docs, you may consider looking at the following pages first:
//!
-//! * [App](struct.App.html): This struct represents an Actix web application and is used to
+//! * [App]: This struct represents an Actix web application and is used to
//! configure routes and other common application settings.
//!
-//! * [HttpServer](struct.HttpServer.html): This struct represents an HTTP server instance and is
+//! * [HttpServer]: This struct represents an HTTP server instance and is
//! used to instantiate and configure servers.
//!
-//! * [web](web/index.html): This module provides essential types for route registration as well as
+//! * [web]: This module provides essential types for route registration as well as
//! common utilities for request handlers.
//!
-//! * [HttpRequest](struct.HttpRequest.html) and [HttpResponse](struct.HttpResponse.html): These
+//! * [HttpRequest] and [HttpResponse]: These
//! structs represent HTTP requests and responses and expose methods for creating, inspecting,
//! and otherwise utilizing them.
//!
diff --git a/src/middleware/logger.rs b/src/middleware/logger.rs
index b2e5c791f..563cb6c32 100644
--- a/src/middleware/logger.rs
+++ b/src/middleware/logger.rs
@@ -82,11 +82,10 @@ use crate::HttpResponse;
///
/// # Security
/// **\*** It is calculated using
-/// [`ConnectionInfo::realip_remote_addr()`](../dev/struct.ConnectionInfo.html#method.realip_remote_addr)
+/// [`ConnectionInfo::realip_remote_addr()`](crate::dev::ConnectionInfo::realip_remote_addr())
///
/// If you use this value ensure that all requests come from trusted hosts, since it is trivial
/// for the remote client to simulate being another client.
-///
pub struct Logger(Rc);
struct Inner {
diff --git a/src/server.rs b/src/server.rs
index 3badb6e8d..be97e8a0d 100644
--- a/src/server.rs
+++ b/src/server.rs
@@ -213,7 +213,7 @@ where
/// Set server host name.
///
/// Host name is used by application router as a hostname for url generation.
- /// Check [ConnectionInfo](./dev/struct.ConnectionInfo.html#method.host)
+ /// Check [ConnectionInfo](super::dev::ConnectionInfo::host())
/// documentation for more information.
///
/// By default host name is set to a "localhost" value.
diff --git a/src/service.rs b/src/service.rs
index a861ba38c..189ba5554 100644
--- a/src/service.rs
+++ b/src/service.rs
@@ -195,13 +195,13 @@ impl ServiceRequest {
self.0.match_info()
}
- /// Counterpart to [`HttpRequest::match_name`](../struct.HttpRequest.html#method.match_name).
+ /// Counterpart to [`HttpRequest::match_name`](super::HttpRequest::match_name()).
#[inline]
pub fn match_name(&self) -> Option<&str> {
self.0.match_name()
}
- /// Counterpart to [`HttpRequest::match_pattern`](../struct.HttpRequest.html#method.match_pattern).
+ /// Counterpart to [`HttpRequest::match_pattern`](super::HttpRequest::match_pattern()).
#[inline]
pub fn match_pattern(&self) -> Option {
self.0.match_pattern()
@@ -225,7 +225,7 @@ impl ServiceRequest {
self.0.app_config()
}
- /// Counterpart to [`HttpRequest::app_data`](../struct.HttpRequest.html#method.app_data).
+ /// Counterpart to [`HttpRequest::app_data`](super::HttpRequest::app_data()).
pub fn app_data(&self) -> Option<&T> {
for container in (self.0).0.app_data.iter().rev() {
if let Some(data) = container.get::() {
diff --git a/src/types/form.rs b/src/types/form.rs
index 2a7101287..82ea73216 100644
--- a/src/types/form.rs
+++ b/src/types/form.rs
@@ -35,7 +35,7 @@ use crate::{responder::Responder, web};
/// To extract typed information from request's body, the type `T` must
/// implement the `Deserialize` trait from *serde*.
///
-/// [**FormConfig**](struct.FormConfig.html) allows to configure extraction
+/// [**FormConfig**](FormConfig) allows to configure extraction
/// process.
///
/// ### Example
diff --git a/src/types/json.rs b/src/types/json.rs
index 081a022e8..83c9f21b0 100644
--- a/src/types/json.rs
+++ b/src/types/json.rs
@@ -31,7 +31,7 @@ use crate::{responder::Responder, web};
/// To extract typed information from request's body, the type `T` must
/// implement the `Deserialize` trait from *serde*.
///
-/// [**JsonConfig**](struct.JsonConfig.html) allows to configure extraction
+/// [**JsonConfig**](JsonConfig) allows to configure extraction
/// process.
///
/// ## Example
@@ -142,7 +142,7 @@ impl Responder for Json {
/// To extract typed information from request's body, the type `T` must
/// implement the `Deserialize` trait from *serde*.
///
-/// [**JsonConfig**](struct.JsonConfig.html) allows to configure extraction
+/// [**JsonConfig**](JsonConfig) allows to configure extraction
/// process.
///
/// ## Example
@@ -306,7 +306,7 @@ impl Default for JsonConfig {
/// Returns error:
///
/// * content type is not `application/json`
-/// (unless specified in [`JsonConfig`](struct.JsonConfig.html))
+/// (unless specified in [`JsonConfig`])
/// * content length is greater than 256k
pub struct JsonBody {
limit: usize,
diff --git a/src/types/path.rs b/src/types/path.rs
index dbb5f3ee0..640ff4346 100644
--- a/src/types/path.rs
+++ b/src/types/path.rs
@@ -15,7 +15,7 @@ use crate::FromRequest;
#[derive(PartialEq, Eq, PartialOrd, Ord)]
/// Extract typed information from the request's path.
///
-/// [**PathConfig**](struct.PathConfig.html) allows to configure extraction process.
+/// [**PathConfig**](PathConfig) allows to configure extraction process.
///
/// ## Example
///
diff --git a/src/types/payload.rs b/src/types/payload.rs
index fdc1f8c8a..acb8b9a82 100644
--- a/src/types/payload.rs
+++ b/src/types/payload.rs
@@ -111,7 +111,7 @@ impl FromRequest for Payload {
///
/// Loads request's payload and construct Bytes instance.
///
-/// [**PayloadConfig**](struct.PayloadConfig.html) allows to configure
+/// [**PayloadConfig**](PayloadConfig) allows to configure
/// extraction process.
///
/// ## Example
@@ -159,7 +159,7 @@ impl FromRequest for Bytes {
///
/// Text extractor automatically decode body according to the request's charset.
///
-/// [**PayloadConfig**](struct.PayloadConfig.html) allows to configure
+/// [**PayloadConfig**](PayloadConfig) allows to configure
/// extraction process.
///
/// ## Example
diff --git a/src/types/query.rs b/src/types/query.rs
index 7eded49c5..27df220fc 100644
--- a/src/types/query.rs
+++ b/src/types/query.rs
@@ -18,7 +18,7 @@ use crate::request::HttpRequest;
/// be decoded into any type which depends upon data ordering e.g. tuples or tuple-structs.
/// Attempts to do so will *fail at runtime*.
///
-/// [**QueryConfig**](struct.QueryConfig.html) allows to configure extraction process.
+/// [**QueryConfig**](QueryConfig) allows to configure extraction process.
///
/// ## Example
///
From d7ce6484457be229c4c9b4fcd3581d599b7ff9f1 Mon Sep 17 00:00:00 2001
From: fakeshadow <24548779@qq.com>
Date: Thu, 17 Dec 2020 02:34:10 +0800
Subject: [PATCH 41/81] remove boxed future for Option and Result
extract type (#1829)
* remove boxed future for Option and Result extract type
* use ready macro
* fix fmt
---
src/extract.rs | 81 ++++++++++++++++++++++++++++++++++++--------------
1 file changed, 59 insertions(+), 22 deletions(-)
diff --git a/src/extract.rs b/src/extract.rs
index df9c34cb3..5916b1bc5 100644
--- a/src/extract.rs
+++ b/src/extract.rs
@@ -4,7 +4,8 @@ use std::pin::Pin;
use std::task::{Context, Poll};
use actix_http::error::Error;
-use futures_util::future::{ok, FutureExt, LocalBoxFuture, Ready};
+use futures_util::future::{ready, Ready};
+use futures_util::ready;
use crate::dev::Payload;
use crate::request::HttpRequest;
@@ -95,21 +96,41 @@ where
T: FromRequest,
T::Future: 'static,
{
- type Config = T::Config;
type Error = Error;
- type Future = LocalBoxFuture<'static, Result