-
Actix web
+
Actix Web
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.2)
+[](https://docs.rs/actix-web/4.0.0-beta.2)
[](https://blog.rust-lang.org/2020/03/12/Rust-1.46.html)
-
-[](https://deps.rs/crate/actix-web/3.3.2)
+
+[](https://deps.rs/crate/actix-web/4.0.0-beta.2)
-[](https://travis-ci.org/actix/actix-web)
+[](https://github.com/actix/actix-web/actions)
[](https://codecov.io/gh/actix/actix-web)
-[](https://crates.io/crates/actix-web)
-[](https://gitter.im/actix/actix?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+
[](https://discord.gg/NWpN5mmg3x)
@@ -32,8 +31,7 @@
* Static assets
* SSL support using OpenSSL or Rustls
* Middlewares ([Logger, Session, CORS, etc](https://actix.rs/docs/middleware/))
-* Includes an async [HTTP client](https://actix.rs/actix-web/actix_web/client/index.html)
-* Supports [Actix actor framework](https://github.com/actix/actix)
+* Includes an async [HTTP client](https://docs.rs/actix-web/latest/actix_web/client/index.html)
* Runs on stable Rust 1.46+
## Documentation
@@ -99,13 +97,13 @@ One of the fastest web frameworks available according to the
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))
+ [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))
+ [http://opensource.org/licenses/MIT])
at your option.
## Code of Conduct
-Contribution to the actix-web crate is organized under the terms of the Contributor Covenant, the
-maintainers of Actix web, promises to intervene to uphold that code of conduct.
+Contribution to the actix-web repo is organized under the terms of the Contributor Covenant.
+The Actix team promises to intervene to uphold that code of conduct.
diff --git a/actix-files/CHANGES.md b/actix-files/CHANGES.md
index 49768419b..6e2a241ac 100644
--- a/actix-files/CHANGES.md
+++ b/actix-files/CHANGES.md
@@ -1,7 +1,21 @@
# Changes
-## Unreleased - 2020-xx-xx
+## Unreleased - 2021-xx-xx
+
+
+## 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
diff --git a/actix-files/Cargo.toml b/actix-files/Cargo.toml
index b67abb1c1..08b7b36fc 100644
--- a/actix-files/Cargo.toml
+++ b/actix-files/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "actix-files"
-version = "0.5.0"
+version = "0.6.0-beta.2"
authors = ["Nikolay Kim
"]
description = "Static file serving for Actix Web"
readme = "README.md"
@@ -17,19 +17,21 @@ name = "actix_files"
path = "src/lib.rs"
[dependencies]
-actix-web = { version = "3.0.0", default-features = false }
-actix-service = "1.0.6"
+actix-web = { version = "4.0.0-beta.3", default-features = false }
+actix-service = "2.0.0-beta.4"
+
+askama_escape = "0.10"
bitflags = "1"
-bytes = "0.5.3"
+bytes = "1"
futures-core = { version = "0.3.7", default-features = false }
futures-util = { version = "0.3.7", default-features = false }
+http-range = "0.1.4"
derive_more = "0.99.5"
log = "0.4"
mime = "0.3"
mime_guess = "2.0.1"
percent-encoding = "2.1"
-v_htmlescape = "0.12"
[dev-dependencies]
-actix-rt = "1.0.0"
-actix-web = "3.0.0"
+actix-rt = "2"
+actix-web = "4.0.0-beta.3"
diff --git a/actix-files/src/chunked.rs b/actix-files/src/chunked.rs
index 580b06787..f639848c9 100644
--- a/actix-files/src/chunked.rs
+++ b/actix-files/src/chunked.rs
@@ -9,26 +9,35 @@ use std::{
use actix_web::{
error::{BlockingError, Error},
- web,
+ rt::task::{spawn_blocking, JoinHandle},
};
use bytes::Bytes;
use futures_core::{ready, Stream};
-use futures_util::future::{FutureExt, LocalBoxFuture};
-
-use crate::handle_error;
-
-type ChunkedBoxFuture =
- LocalBoxFuture<'static, Result<(File, Bytes), BlockingError>>;
#[doc(hidden)]
/// A helper created from a `std::fs::File` which reads the file
/// chunk-by-chunk on a `ThreadPool`.
pub struct ChunkedReadFile {
- pub(crate) size: u64,
- pub(crate) offset: u64,
- pub(crate) file: Option,
- pub(crate) fut: Option,
- pub(crate) counter: u64,
+ size: u64,
+ offset: u64,
+ state: ChunkedReadFileState,
+ counter: u64,
+}
+
+enum ChunkedReadFileState {
+ File(Option),
+ Future(JoinHandle>),
+}
+
+impl ChunkedReadFile {
+ pub(crate) fn new(size: u64, offset: u64, file: File) -> Self {
+ Self {
+ size,
+ offset,
+ state: ChunkedReadFileState::File(Some(file)),
+ counter: 0,
+ }
+ }
}
impl fmt::Debug for ChunkedReadFile {
@@ -40,55 +49,50 @@ impl fmt::Debug for ChunkedReadFile {
impl Stream for ChunkedReadFile {
type Item = Result;
- fn poll_next(
- mut self: Pin<&mut Self>,
- cx: &mut Context<'_>,
- ) -> Poll