mirror of
https://github.com/fafhrd91/actix-web
synced 2025-08-04 22:25:42 +02:00
Compare commits
10 Commits
http-v2.0.
...
web-v3.0.0
Author | SHA1 | Date | |
---|---|---|---|
|
5802eb797f | ||
|
ff2ca0f420 | ||
|
59ad1738e9 | ||
|
aa2bd6fbfb | ||
|
5aad8e24c7 | ||
|
6e97bc09f8 | ||
|
160995b8d4 | ||
|
187646b2f9 | ||
|
46627be36f | ||
|
a78380739e |
2
.github/workflows/bench.yml
vendored
2
.github/workflows/bench.yml
vendored
@@ -12,7 +12,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Install Rust
|
- name: Install Rust
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
|
2
.github/workflows/linux.yml
vendored
2
.github/workflows/linux.yml
vendored
@@ -21,7 +21,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Install ${{ matrix.version }}
|
- name: Install ${{ matrix.version }}
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
|
2
.github/workflows/macos.yml
vendored
2
.github/workflows/macos.yml
vendored
@@ -20,7 +20,7 @@ jobs:
|
|||||||
runs-on: macOS-latest
|
runs-on: macOS-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Install ${{ matrix.version }}
|
- name: Install ${{ matrix.version }}
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
|
12
.github/workflows/upload-doc.yml
vendored
12
.github/workflows/upload-doc.yml
vendored
@@ -11,7 +11,7 @@ jobs:
|
|||||||
if: github.repository == 'actix/actix-web'
|
if: github.repository == 'actix/actix-web'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Install Rust
|
- name: Install Rust
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
@@ -29,7 +29,9 @@ jobs:
|
|||||||
- name: Tweak HTML
|
- name: Tweak HTML
|
||||||
run: echo "<meta http-equiv=refresh content=0;url=os_balloon/index.html>" > target/doc/index.html
|
run: echo "<meta http-equiv=refresh content=0;url=os_balloon/index.html>" > target/doc/index.html
|
||||||
|
|
||||||
- name: Upload documentation
|
- name: Deploy to GitHub Pages
|
||||||
run: |
|
uses: JamesIves/github-pages-deploy-action@3.5.8
|
||||||
git clone https://github.com/davisp/ghp-import.git
|
with:
|
||||||
./ghp-import/ghp_import.py -n -p -f -m "Documentation upload" -r https://${{ secrets.GITHUB_TOKEN }}@github.com/"${{ github.repository }}.git" target/doc
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
BRANCH: gh-pages
|
||||||
|
FOLDER: target/doc
|
||||||
|
2
.github/workflows/windows.yml
vendored
2
.github/workflows/windows.yml
vendored
@@ -23,7 +23,7 @@ jobs:
|
|||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Install ${{ matrix.version }}
|
- name: Install ${{ matrix.version }}
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@@ -9,6 +9,7 @@ guide/build/
|
|||||||
*.pid
|
*.pid
|
||||||
*.sock
|
*.sock
|
||||||
*~
|
*~
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
# These are backup files generated by rustfmt
|
# These are backup files generated by rustfmt
|
||||||
**/*.rs.bk
|
**/*.rs.bk
|
||||||
|
11
CHANGES.md
11
CHANGES.md
@@ -1,11 +1,18 @@
|
|||||||
# Changes
|
# Changes
|
||||||
|
|
||||||
## Unreleased - 2020-xx-xx
|
## 3.0.0-beta.3 - 2020-08-17
|
||||||
|
### Changed
|
||||||
|
* Update `rustls` to 0.18
|
||||||
|
|
||||||
|
## 3.0.0-beta.2 - 2020-08-17
|
||||||
### Changed
|
### Changed
|
||||||
* `PayloadConfig` is now also considered in `Bytes` and `String` extractors when set
|
* `PayloadConfig` is now also considered in `Bytes` and `String` extractors when set
|
||||||
using `App::data`. [#1610]
|
using `App::data`. [#1610]
|
||||||
* `web::Path` now has a public representation: `web::Path(pub T)` that enables
|
* `web::Path` now has a public representation: `web::Path(pub T)` that enables
|
||||||
destructuring. [#1594]
|
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.
|
* MSRV is now 1.42.0.
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
@@ -14,6 +21,8 @@
|
|||||||
[#1594]: https://github.com/actix/actix-web/pull/1594
|
[#1594]: https://github.com/actix/actix-web/pull/1594
|
||||||
[#1609]: https://github.com/actix/actix-web/pull/1609
|
[#1609]: https://github.com/actix/actix-web/pull/1609
|
||||||
[#1610]: https://github.com/actix/actix-web/pull/1610
|
[#1610]: https://github.com/actix/actix-web/pull/1610
|
||||||
|
[#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
|
## 3.0.0-beta.1 - 2020-07-13
|
||||||
|
14
Cargo.toml
14
Cargo.toml
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "actix-web"
|
name = "actix-web"
|
||||||
version = "3.0.0-beta.1"
|
version = "3.0.0-beta.3"
|
||||||
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
||||||
description = "Actix web is a simple, pragmatic and extremely fast web framework for Rust."
|
description = "Actix web is a simple, pragmatic and extremely fast web framework for Rust."
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
@@ -74,11 +74,11 @@ actix-server = "1.0.0"
|
|||||||
actix-testing = "1.0.0"
|
actix-testing = "1.0.0"
|
||||||
actix-macros = "0.1.0"
|
actix-macros = "0.1.0"
|
||||||
actix-threadpool = "0.3.1"
|
actix-threadpool = "0.3.1"
|
||||||
actix-tls = "2.0.0-alpha.1"
|
actix-tls = "2.0.0-alpha.2"
|
||||||
|
|
||||||
actix-web-codegen = "0.3.0-beta.1"
|
actix-web-codegen = "0.3.0-beta.1"
|
||||||
actix-http = "2.0.0-alpha.4"
|
actix-http = "2.0.0-beta.3"
|
||||||
awc = { version = "2.0.0-beta.1", default-features = false }
|
awc = { version = "2.0.0-beta.3", default-features = false }
|
||||||
|
|
||||||
bytes = "0.5.3"
|
bytes = "0.5.3"
|
||||||
derive_more = "0.99.2"
|
derive_more = "0.99.2"
|
||||||
@@ -98,7 +98,7 @@ serde_urlencoded = "0.6.1"
|
|||||||
time = { version = "0.2.7", default-features = false, features = ["std"] }
|
time = { version = "0.2.7", default-features = false, features = ["std"] }
|
||||||
url = "2.1"
|
url = "2.1"
|
||||||
open-ssl = { package = "openssl", version = "0.10", optional = true }
|
open-ssl = { package = "openssl", version = "0.10", optional = true }
|
||||||
rust-tls = { package = "rustls", version = "0.17.0", optional = true }
|
rust-tls = { package = "rustls", version = "0.18.0", optional = true }
|
||||||
tinyvec = { version = "0.3", features = ["alloc"] }
|
tinyvec = { version = "0.3", features = ["alloc"] }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
@@ -124,6 +124,10 @@ actix-files = { path = "actix-files" }
|
|||||||
actix-multipart = { path = "actix-multipart" }
|
actix-multipart = { path = "actix-multipart" }
|
||||||
awc = { path = "awc" }
|
awc = { path = "awc" }
|
||||||
|
|
||||||
|
[[example]]
|
||||||
|
name = "client"
|
||||||
|
required-features = ["rustls"]
|
||||||
|
|
||||||
[[bench]]
|
[[bench]]
|
||||||
name = "server"
|
name = "server"
|
||||||
harness = false
|
harness = false
|
||||||
|
@@ -17,8 +17,8 @@ name = "actix_files"
|
|||||||
path = "src/lib.rs"
|
path = "src/lib.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
actix-web = { version = "3.0.0-beta.1", default-features = false }
|
actix-web = { version = "3.0.0-beta.3", default-features = false }
|
||||||
actix-http = "2.0.0-beta.1"
|
actix-http = "2.0.0-beta.3"
|
||||||
actix-service = "1.0.1"
|
actix-service = "1.0.1"
|
||||||
bitflags = "1"
|
bitflags = "1"
|
||||||
bytes = "0.5.3"
|
bytes = "0.5.3"
|
||||||
@@ -33,4 +33,4 @@ v_htmlescape = "0.10"
|
|||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
actix-rt = "1.0.0"
|
actix-rt = "1.0.0"
|
||||||
actix-web = { version = "3.0.0-beta.1", features = ["openssl"] }
|
actix-web = { version = "3.0.0-beta.3", features = ["openssl"] }
|
||||||
|
@@ -1,9 +1,17 @@
|
|||||||
# Changes
|
# Changes
|
||||||
|
|
||||||
## Unreleased - 2020-xx-xx
|
## Unreleased
|
||||||
|
|
||||||
|
|
||||||
## 2.0.0-beta.2 - 2020-07-21
|
## [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
|
### Fixed
|
||||||
* Potential UB in h1 decoder using uninitialized memory. [#1614]
|
* Potential UB in h1 decoder using uninitialized memory. [#1614]
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "actix-http"
|
name = "actix-http"
|
||||||
version = "2.0.0-beta.2"
|
version = "2.0.0-beta.3"
|
||||||
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
||||||
description = "Actix HTTP primitives"
|
description = "Actix HTTP primitives"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
@@ -42,11 +42,11 @@ actors = ["actix"]
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
actix-service = "1.0.5"
|
actix-service = "1.0.5"
|
||||||
actix-codec = "0.2.0"
|
actix-codec = "0.2.0"
|
||||||
actix-connect = "2.0.0-alpha.3"
|
actix-connect = "2.0.0-alpha.4"
|
||||||
actix-utils = "1.0.6"
|
actix-utils = "1.0.6"
|
||||||
actix-rt = "1.0.0"
|
actix-rt = "1.0.0"
|
||||||
actix-threadpool = "0.3.1"
|
actix-threadpool = "0.3.1"
|
||||||
actix-tls = { version = "2.0.0-alpha.1", optional = true }
|
actix-tls = { version = "2.0.0-alpha.2", optional = true }
|
||||||
actix = { version = "0.10.0-alpha.1", optional = true }
|
actix = { version = "0.10.0-alpha.1", optional = true }
|
||||||
|
|
||||||
base64 = "0.12"
|
base64 = "0.12"
|
||||||
@@ -87,14 +87,14 @@ flate2 = { version = "1.0.13", optional = true }
|
|||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
actix-server = "1.0.1"
|
actix-server = "1.0.1"
|
||||||
actix-connect = { version = "2.0.0-alpha.2", features = ["openssl"] }
|
actix-connect = { version = "2.0.0-alpha.4", features = ["openssl"] }
|
||||||
actix-http-test = { version = "2.0.0-alpha.1", features = ["openssl"] }
|
actix-http-test = { version = "2.0.0-alpha.1", features = ["openssl"] }
|
||||||
actix-tls = { version = "2.0.0-alpha.1", features = ["openssl"] }
|
actix-tls = { version = "2.0.0-alpha.2", features = ["openssl"] }
|
||||||
criterion = "0.3"
|
criterion = "0.3"
|
||||||
env_logger = "0.7"
|
env_logger = "0.7"
|
||||||
serde_derive = "1.0"
|
serde_derive = "1.0"
|
||||||
open-ssl = { version="0.10", package = "openssl" }
|
open-ssl = { version="0.10", package = "openssl" }
|
||||||
rust-tls = { version="0.17", package = "rustls" }
|
rust-tls = { version="0.18", package = "rustls" }
|
||||||
|
|
||||||
[[bench]]
|
[[bench]]
|
||||||
name = "content-length"
|
name = "content-length"
|
||||||
|
@@ -2,7 +2,7 @@ use std::cell::RefCell;
|
|||||||
use std::collections::VecDeque;
|
use std::collections::VecDeque;
|
||||||
use std::future::Future;
|
use std::future::Future;
|
||||||
use std::pin::Pin;
|
use std::pin::Pin;
|
||||||
use std::rc::{Rc, Weak};
|
use std::rc::Rc;
|
||||||
use std::task::{Context, Poll};
|
use std::task::{Context, Poll};
|
||||||
use std::time::{Duration, Instant};
|
use std::time::{Duration, Instant};
|
||||||
|
|
||||||
@@ -65,8 +65,8 @@ where
|
|||||||
|
|
||||||
// start support future
|
// start support future
|
||||||
actix_rt::spawn(ConnectorPoolSupport {
|
actix_rt::spawn(ConnectorPoolSupport {
|
||||||
connector: connector_rc.clone(),
|
connector: Rc::clone(&connector_rc),
|
||||||
inner: Rc::downgrade(&inner_rc),
|
inner: Rc::clone(&inner_rc),
|
||||||
});
|
});
|
||||||
|
|
||||||
ConnectionPool(connector_rc, inner_rc)
|
ConnectionPool(connector_rc, inner_rc)
|
||||||
@@ -82,6 +82,13 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<T, Io> Drop for ConnectionPool<T, Io> {
|
||||||
|
fn drop(&mut self) {
|
||||||
|
// wake up the ConnectorPoolSupport when dropping so it can exit properly.
|
||||||
|
self.1.borrow().waker.wake();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<T, Io> Service for ConnectionPool<T, Io>
|
impl<T, Io> Service for ConnectionPool<T, Io>
|
||||||
where
|
where
|
||||||
Io: AsyncRead + AsyncWrite + Unpin + 'static,
|
Io: AsyncRead + AsyncWrite + Unpin + 'static,
|
||||||
@@ -421,7 +428,7 @@ where
|
|||||||
Io: AsyncRead + AsyncWrite + Unpin + 'static,
|
Io: AsyncRead + AsyncWrite + Unpin + 'static,
|
||||||
{
|
{
|
||||||
connector: T,
|
connector: T,
|
||||||
inner: Weak<RefCell<Inner<Io>>>,
|
inner: Rc<RefCell<Inner<Io>>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T, Io> Future for ConnectorPoolSupport<T, Io>
|
impl<T, Io> Future for ConnectorPoolSupport<T, Io>
|
||||||
@@ -435,8 +442,13 @@ where
|
|||||||
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
|
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
|
||||||
let this = self.project();
|
let this = self.project();
|
||||||
|
|
||||||
if let Some(this_inner) = this.inner.upgrade() {
|
if Rc::strong_count(this.inner) == 1 {
|
||||||
let mut inner = this_inner.as_ref().borrow_mut();
|
// If we are last copy of Inner<Io> it means the ConnectionPool is already gone
|
||||||
|
// and we are safe to exit.
|
||||||
|
return Poll::Ready(());
|
||||||
|
}
|
||||||
|
|
||||||
|
let mut inner = this.inner.borrow_mut();
|
||||||
inner.waker.register(cx.waker());
|
inner.waker.register(cx.waker());
|
||||||
|
|
||||||
// check waiters
|
// check waiters
|
||||||
@@ -459,7 +471,7 @@ where
|
|||||||
if let Err(conn) = tx.send(Ok(IoConnection::new(
|
if let Err(conn) = tx.send(Ok(IoConnection::new(
|
||||||
io,
|
io,
|
||||||
created,
|
created,
|
||||||
Some(Acquired(key.clone(), Some(this_inner.clone()))),
|
Some(Acquired(key.clone(), Some(this.inner.clone()))),
|
||||||
))) {
|
))) {
|
||||||
let (io, created) = conn.unwrap().into_inner();
|
let (io, created) = conn.unwrap().into_inner();
|
||||||
inner.release_conn(&key, io, created);
|
inner.release_conn(&key, io, created);
|
||||||
@@ -471,7 +483,7 @@ where
|
|||||||
OpenWaitingConnection::spawn(
|
OpenWaitingConnection::spawn(
|
||||||
key.clone(),
|
key.clone(),
|
||||||
tx,
|
tx,
|
||||||
this_inner.clone(),
|
this.inner.clone(),
|
||||||
this.connector.call(connect),
|
this.connector.call(connect),
|
||||||
inner.config.clone(),
|
inner.config.clone(),
|
||||||
);
|
);
|
||||||
@@ -481,9 +493,6 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
Poll::Pending
|
Poll::Pending
|
||||||
} else {
|
|
||||||
Poll::Ready(())
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -16,7 +16,7 @@ name = "actix_multipart"
|
|||||||
path = "src/lib.rs"
|
path = "src/lib.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
actix-web = { version = "3.0.0-beta.1", default-features = false }
|
actix-web = { version = "3.0.0-beta.3", default-features = false }
|
||||||
actix-service = "1.0.1"
|
actix-service = "1.0.1"
|
||||||
actix-utils = "1.0.3"
|
actix-utils = "1.0.3"
|
||||||
bytes = "0.5.3"
|
bytes = "0.5.3"
|
||||||
@@ -29,4 +29,4 @@ twoway = "0.2"
|
|||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
actix-rt = "1.0.0"
|
actix-rt = "1.0.0"
|
||||||
actix-http = "2.0.0-beta.1"
|
actix-http = "2.0.0-beta.3"
|
||||||
|
@@ -17,8 +17,8 @@ path = "src/lib.rs"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
actix = "0.10.0-alpha.2"
|
actix = "0.10.0-alpha.2"
|
||||||
actix-web = { version = "3.0.0-beta.1", default-features = false }
|
actix-web = { version = "3.0.0-beta.3", default-features = false }
|
||||||
actix-http = "2.0.0-beta.1"
|
actix-http = "2.0.0-beta.3"
|
||||||
actix-codec = "0.2.0"
|
actix-codec = "0.2.0"
|
||||||
bytes = "0.5.2"
|
bytes = "0.5.2"
|
||||||
futures-channel = { version = "0.3.5", default-features = false }
|
futures-channel = { version = "0.3.5", default-features = false }
|
||||||
|
@@ -20,5 +20,5 @@ proc-macro2 = "1"
|
|||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
actix-rt = "1.0.0"
|
actix-rt = "1.0.0"
|
||||||
actix-web = "3.0.0-beta.1"
|
actix-web = "3.0.0-beta.3"
|
||||||
futures-util = { version = "0.3.5", default-features = false }
|
futures-util = { version = "0.3.5", default-features = false }
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
# Changes
|
# Changes
|
||||||
|
|
||||||
## Unreleased - 2020-xx-xx
|
## 2.0.0-beta.3 - 2020-08-17
|
||||||
|
### Changed
|
||||||
|
* Update `rustls` to 0.18
|
||||||
|
|
||||||
|
|
||||||
## 2.0.0-beta.2 - 2020-07-21
|
## 2.0.0-beta.2 - 2020-07-21
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "awc"
|
name = "awc"
|
||||||
version = "2.0.0-beta.2"
|
version = "2.0.0-beta.3"
|
||||||
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
||||||
description = "Async HTTP client library that uses the Actix runtime."
|
description = "Async HTTP client library that uses the Actix runtime."
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
@@ -39,7 +39,7 @@ compress = ["actix-http/compress"]
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
actix-codec = "0.2.0"
|
actix-codec = "0.2.0"
|
||||||
actix-service = "1.0.1"
|
actix-service = "1.0.1"
|
||||||
actix-http = "2.0.0-beta.2"
|
actix-http = "2.0.0-beta.3"
|
||||||
actix-rt = "1.0.0"
|
actix-rt = "1.0.0"
|
||||||
|
|
||||||
base64 = "0.12"
|
base64 = "0.12"
|
||||||
@@ -54,16 +54,16 @@ serde = "1.0"
|
|||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
serde_urlencoded = "0.6.1"
|
serde_urlencoded = "0.6.1"
|
||||||
open-ssl = { version = "0.10", package = "openssl", optional = true }
|
open-ssl = { version = "0.10", package = "openssl", optional = true }
|
||||||
rust-tls = { version = "0.17.0", package = "rustls", optional = true, features = ["dangerous_configuration"] }
|
rust-tls = { version = "0.18.0", package = "rustls", optional = true, features = ["dangerous_configuration"] }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
actix-connect = { version = "2.0.0-alpha.2", features = ["openssl"] }
|
actix-connect = { version = "2.0.0-alpha.4", features = ["openssl"] }
|
||||||
actix-web = { version = "3.0.0-alpha.3", features = ["openssl"] }
|
actix-web = { version = "3.0.0-beta.3", features = ["openssl"] }
|
||||||
actix-http = { version = "2.0.0-beta.2", features = ["openssl"] }
|
actix-http = { version = "2.0.0-beta.3", features = ["openssl"] }
|
||||||
actix-http-test = { version = "2.0.0-alpha.1", features = ["openssl"] }
|
actix-http-test = { version = "2.0.0-alpha.1", features = ["openssl"] }
|
||||||
actix-utils = "1.0.3"
|
actix-utils = "1.0.3"
|
||||||
actix-server = "1.0.0"
|
actix-server = "1.0.0"
|
||||||
actix-tls = { version = "2.0.0-alpha.1", features = ["openssl", "rustls"] }
|
actix-tls = { version = "2.0.0-alpha.2", features = ["openssl", "rustls"] }
|
||||||
brotli2 = "0.3.2"
|
brotli2 = "0.3.2"
|
||||||
flate2 = "1.0.13"
|
flate2 = "1.0.13"
|
||||||
futures-util = { version = "0.3.5", default-features = false }
|
futures-util = { version = "0.3.5", default-features = false }
|
||||||
|
2
docs/graphs/.gitignore
vendored
Normal file
2
docs/graphs/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# do not track rendered graphs
|
||||||
|
*.png
|
11
docs/graphs/dependency-graphs.md
Normal file
11
docs/graphs/dependency-graphs.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# Actix Ecosystem Dependency Graphs
|
||||||
|
|
||||||
|
See rendered versions of these dot graphs [on the wiki](https://github.com/actix/actix-web/wiki/Dependency-Graph).
|
||||||
|
|
||||||
|
## Rendering
|
||||||
|
|
||||||
|
Dot graphs were rendered using the `dot` command from [GraphViz](https://www.graphviz.org/doc/info/command.html):
|
||||||
|
|
||||||
|
```sh
|
||||||
|
for f in $(ls docs/graphs/*.dot | xargs); do dot $f -Tpng -o${f:r}.png; done
|
||||||
|
```
|
25
docs/graphs/net-only.dot
Normal file
25
docs/graphs/net-only.dot
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
digraph {
|
||||||
|
subgraph cluster_net {
|
||||||
|
label="actix/actix-net";
|
||||||
|
"actix-codec"
|
||||||
|
"actix-connect"
|
||||||
|
"actix-macros"
|
||||||
|
"actix-rt"
|
||||||
|
"actix-server"
|
||||||
|
"actix-service"
|
||||||
|
"actix-testing"
|
||||||
|
"actix-threadpool"
|
||||||
|
"actix-tls"
|
||||||
|
"actix-tracing"
|
||||||
|
"actix-utils"
|
||||||
|
"actix-router"
|
||||||
|
}
|
||||||
|
|
||||||
|
"actix-utils" -> { "actix-service" "actix-rt" "actix-codec" }
|
||||||
|
"actix-tracing" -> { "actix-service" }
|
||||||
|
"actix-tls" -> { "actix-service" "actix-codec" "actix-utils" "actix-rt" }
|
||||||
|
"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" }
|
||||||
|
}
|
30
docs/graphs/web-focus.dot
Normal file
30
docs/graphs/web-focus.dot
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
digraph {
|
||||||
|
subgraph cluster_web {
|
||||||
|
label="actix/actix-web"
|
||||||
|
"awc"
|
||||||
|
"actix-web"
|
||||||
|
"actix-files"
|
||||||
|
"actix-http"
|
||||||
|
"actix-multipart"
|
||||||
|
"actix-web-actors"
|
||||||
|
"actix-web-codegen"
|
||||||
|
}
|
||||||
|
|
||||||
|
"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" }
|
||||||
|
|
||||||
|
// net
|
||||||
|
|
||||||
|
"actix-utils" -> { "actix-service" "actix-rt" "actix-codec" }
|
||||||
|
"actix-tracing" -> { "actix-service" }
|
||||||
|
"actix-tls" -> { "actix-service" "actix-codec" "actix-utils" "actix-rt" }
|
||||||
|
"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" }
|
||||||
|
}
|
19
docs/graphs/web-only.dot
Normal file
19
docs/graphs/web-only.dot
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
digraph {
|
||||||
|
subgraph cluster_web {
|
||||||
|
label="actix/actix-web"
|
||||||
|
"awc"
|
||||||
|
"actix-web"
|
||||||
|
"actix-files"
|
||||||
|
"actix-http"
|
||||||
|
"actix-multipart"
|
||||||
|
"actix-web-actors"
|
||||||
|
"actix-web-codegen"
|
||||||
|
}
|
||||||
|
|
||||||
|
"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" }
|
||||||
|
}
|
@@ -213,9 +213,7 @@ pub mod client {
|
|||||||
//! }
|
//! }
|
||||||
//! ```
|
//! ```
|
||||||
|
|
||||||
pub use awc::error::{
|
pub use awc::error::*;
|
||||||
ConnectError, InvalidUrl, PayloadError, SendRequestError, WsClientError,
|
|
||||||
};
|
|
||||||
pub use awc::{
|
pub use awc::{
|
||||||
test, Client, ClientBuilder, ClientRequest, ClientResponse, Connector,
|
test, Client, ClientBuilder, ClientRequest, ClientResponse, Connector,
|
||||||
};
|
};
|
||||||
|
@@ -12,7 +12,6 @@ use actix_router::{IntoPattern, Path, Resource, ResourceDef, Url};
|
|||||||
use actix_service::{IntoServiceFactory, ServiceFactory};
|
use actix_service::{IntoServiceFactory, ServiceFactory};
|
||||||
|
|
||||||
use crate::config::{AppConfig, AppService};
|
use crate::config::{AppConfig, AppService};
|
||||||
use crate::data::Data;
|
|
||||||
use crate::dev::insert_slash;
|
use crate::dev::insert_slash;
|
||||||
use crate::guard::Guard;
|
use crate::guard::Guard;
|
||||||
use crate::info::ConnectionInfo;
|
use crate::info::ConnectionInfo;
|
||||||
@@ -226,12 +225,11 @@ impl ServiceRequest {
|
|||||||
self.0.app_config()
|
self.0.app_config()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get an application data stored with `App::data()` method during
|
/// Counterpart to [`HttpRequest::app_data`](../struct.HttpRequest.html#method.app_data).
|
||||||
/// application configuration.
|
pub fn app_data<T: 'static>(&self) -> Option<&T> {
|
||||||
pub fn app_data<T: 'static>(&self) -> Option<Data<T>> {
|
|
||||||
for container in (self.0).0.app_data.iter().rev() {
|
for container in (self.0).0.app_data.iter().rev() {
|
||||||
if let Some(data) = container.get::<Data<T>>() {
|
if let Some(data) = container.get::<T>() {
|
||||||
return Some(Data::clone(&data));
|
return Some(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -595,6 +593,28 @@ mod tests {
|
|||||||
let resp = srv.call(req).await.unwrap();
|
let resp = srv.call(req).await.unwrap();
|
||||||
assert_eq!(resp.status(), http::StatusCode::NOT_FOUND);
|
assert_eq!(resp.status(), http::StatusCode::NOT_FOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[actix_rt::test]
|
||||||
|
async fn test_service_data() {
|
||||||
|
let mut srv = init_service(
|
||||||
|
App::new()
|
||||||
|
.data(42u32)
|
||||||
|
.service(web::service("/test").name("test").finish(
|
||||||
|
|req: ServiceRequest| {
|
||||||
|
assert_eq!(
|
||||||
|
req.app_data::<web::Data<u32>>().unwrap().as_ref(),
|
||||||
|
&42
|
||||||
|
);
|
||||||
|
ok(req.into_response(HttpResponse::Ok().finish()))
|
||||||
|
},
|
||||||
|
)),
|
||||||
|
)
|
||||||
|
.await;
|
||||||
|
let req = TestRequest::with_uri("/test").to_request();
|
||||||
|
let resp = srv.call(req).await.unwrap();
|
||||||
|
assert_eq!(resp.status(), http::StatusCode::OK);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_fmt_debug() {
|
fn test_fmt_debug() {
|
||||||
let req = TestRequest::get()
|
let req = TestRequest::get()
|
||||||
|
@@ -31,12 +31,12 @@ openssl = ["open-ssl", "awc/openssl"]
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
actix-service = "1.0.1"
|
actix-service = "1.0.1"
|
||||||
actix-codec = "0.2.0"
|
actix-codec = "0.2.0"
|
||||||
actix-connect = "2.0.0-alpha.2"
|
actix-connect = "2.0.0-alpha.4"
|
||||||
actix-utils = "1.0.3"
|
actix-utils = "1.0.3"
|
||||||
actix-rt = "1.0.0"
|
actix-rt = "1.0.0"
|
||||||
actix-server = "1.0.0"
|
actix-server = "1.0.0"
|
||||||
actix-testing = "1.0.0"
|
actix-testing = "1.0.0"
|
||||||
awc = "2.0.0-alpha.2"
|
awc = "2.0.0-beta.3"
|
||||||
|
|
||||||
base64 = "0.12"
|
base64 = "0.12"
|
||||||
bytes = "0.5.3"
|
bytes = "0.5.3"
|
||||||
@@ -52,5 +52,5 @@ time = { version = "0.2.7", default-features = false, features = ["std"] }
|
|||||||
open-ssl = { version = "0.10", package = "openssl", optional = true }
|
open-ssl = { version = "0.10", package = "openssl", optional = true }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
actix-web = "3.0.0-alpha.3"
|
actix-web = "3.0.0-beta.3"
|
||||||
actix-http = "2.0.0-beta.1"
|
actix-http = "2.0.0-beta.3"
|
||||||
|
Reference in New Issue
Block a user