mirror of
https://github.com/actix/actix-web.git
synced 2024-06-13 10:49:26 +00:00
Merge 2b6cfb9391
into 1114a51b22
This commit is contained in:
commit
9837dab6da
|
@ -49,3 +49,6 @@ awc = { path = "awc" }
|
|||
# actix-utils = { path = "../actix-net/actix-utils" }
|
||||
# actix-tls = { path = "../actix-net/actix-tls" }
|
||||
# actix-server = { path = "../actix-net/actix-server" }
|
||||
|
||||
# Added for testing purpose while https://github.com/actix/actix-net/pull/508 is released
|
||||
actix-tls = { git = "https://github.com/actix/actix-net", rev = "1945fa06755555dfd96eb1de5b02d6ee40a81f22" }
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
## Unreleased
|
||||
|
||||
- Minimum supported Rust version (MSRV) is now 1.68 due to transitive `time` dependency.
|
||||
- Updated `actix-tls` dependency to `3.2`.
|
||||
- Added feature `http-1` for support to `http` crate version `1`.
|
||||
|
||||
## 3.1.0
|
||||
|
||||
|
|
|
@ -28,10 +28,13 @@ default = []
|
|||
# openssl
|
||||
openssl = ["tls-openssl", "awc/openssl"]
|
||||
|
||||
# use http crate v1
|
||||
http-1 = ["dep:http-1", "awc/http-1"]
|
||||
|
||||
[dependencies]
|
||||
actix-service = "2"
|
||||
actix-codec = "0.5"
|
||||
actix-tls = "3"
|
||||
actix-tls = "3.1.1"
|
||||
actix-utils = "3"
|
||||
actix-rt = "2.2"
|
||||
actix-server = "2"
|
||||
|
@ -39,7 +42,8 @@ awc = { version = "3", default-features = false }
|
|||
|
||||
bytes = "1"
|
||||
futures-core = { version = "0.3.17", default-features = false }
|
||||
http = "0.2.7"
|
||||
http = "0.2"
|
||||
http-1 = { version = "1", optional = true, package = "http" }
|
||||
log = "0.4"
|
||||
socket2 = "0.5"
|
||||
serde = "1"
|
||||
|
|
|
@ -10,6 +10,9 @@
|
|||
#[cfg(feature = "openssl")]
|
||||
extern crate tls_openssl as openssl;
|
||||
|
||||
#[cfg(feature = "http-1")]
|
||||
extern crate http_1 as http;
|
||||
|
||||
use std::{net, thread, time::Duration};
|
||||
|
||||
use actix_codec::{AsyncRead, AsyncWrite, Framed};
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
### Changed
|
||||
|
||||
- Updated `zstd` dependency to `0.13`.
|
||||
- Updated `http` dependency to `1`.
|
||||
- Updated `h2` dependency to `0.4`.
|
||||
- Updated `actix-tls` dependency to `3.2`.
|
||||
- Added feature `http-1` for support to `http` crate version `1`.
|
||||
|
||||
### Fixed
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "actix-http"
|
||||
version = "3.4.0"
|
||||
version = "3.5.0"
|
||||
authors = [
|
||||
"Nikolay Kim <fafhrd91@gmail.com>",
|
||||
"Rob Ede <robjtede@icloud.com>",
|
||||
|
@ -33,6 +33,9 @@ default = []
|
|||
# HTTP/2 protocol support
|
||||
http2 = ["h2"]
|
||||
|
||||
# use http crate v1
|
||||
http-1 = ["dep:http-1", "dep:h2-0_4"]
|
||||
|
||||
# WebSocket protocol implementation
|
||||
ws = [
|
||||
"local-channel",
|
||||
|
@ -75,7 +78,8 @@ bytestring = "1"
|
|||
derive_more = "0.99.5"
|
||||
encoding_rs = "0.8"
|
||||
futures-core = { version = "0.3.17", default-features = false, features = ["alloc"] }
|
||||
http = "0.2.7"
|
||||
http = "0.2"
|
||||
http-1 = {version = "1", optional = true, package = "http" }
|
||||
httparse = "1.5.1"
|
||||
httpdate = "1.0.1"
|
||||
itoa = "1"
|
||||
|
@ -89,7 +93,8 @@ tokio-util = { version = "0.7", features = ["io", "codec"] }
|
|||
tracing = { version = "0.1.30", default-features = false, features = ["log"] }
|
||||
|
||||
# http2
|
||||
h2 = { version = "0.3.17", optional = true }
|
||||
h2 = { version = "0.3", optional = true }
|
||||
h2-0_4 = { package = "h2", version = "0.4", optional = true }
|
||||
|
||||
# websockets
|
||||
local-channel = { version = "0.1", optional = true }
|
||||
|
@ -98,7 +103,7 @@ rand = { version = "0.8", optional = true }
|
|||
sha1 = { version = "0.10", optional = true }
|
||||
|
||||
# openssl/rustls
|
||||
actix-tls = { version = "3.1", default-features = false, optional = true }
|
||||
actix-tls = { version = "3.1.1", default-features = false, optional = true }
|
||||
|
||||
# compress-*
|
||||
brotli = { version = "3.3.3", optional = true }
|
||||
|
@ -108,7 +113,7 @@ zstd = { version = "0.13", optional = true }
|
|||
[dev-dependencies]
|
||||
actix-http-test = { version = "3", features = ["openssl"] }
|
||||
actix-server = "2"
|
||||
actix-tls = { version = "3.1", features = ["openssl"] }
|
||||
actix-tls = { version = "3.1.1", features = ["openssl"] }
|
||||
actix-web = "4"
|
||||
|
||||
async-stream = "0.3"
|
||||
|
|
|
@ -6,6 +6,9 @@ use derive_more::{Display, Error, From};
|
|||
pub use http::Error as HttpError;
|
||||
use http::{uri::InvalidUri, StatusCode};
|
||||
|
||||
#[cfg(feature = "http-1")]
|
||||
use h2_0_4 as h2;
|
||||
|
||||
use crate::{body::BoxBody, Response};
|
||||
|
||||
pub struct Error {
|
||||
|
@ -274,7 +277,7 @@ pub enum PayloadError {
|
|||
/// HTTP/2 payload error.
|
||||
#[cfg(feature = "http2")]
|
||||
#[display(fmt = "{}", _0)]
|
||||
Http2Payload(::h2::Error),
|
||||
Http2Payload(h2::Error),
|
||||
|
||||
/// Generic I/O error.
|
||||
#[display(fmt = "{}", _0)]
|
||||
|
@ -297,8 +300,8 @@ impl std::error::Error for PayloadError {
|
|||
}
|
||||
|
||||
#[cfg(feature = "http2")]
|
||||
impl From<::h2::Error> for PayloadError {
|
||||
fn from(err: ::h2::Error) -> Self {
|
||||
impl From<h2::Error> for PayloadError {
|
||||
fn from(err: h2::Error) -> Self {
|
||||
PayloadError::Http2Payload(err)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,6 +15,9 @@ use actix_service::Service;
|
|||
use actix_utils::future::poll_fn;
|
||||
use bytes::{Bytes, BytesMut};
|
||||
use futures_core::ready;
|
||||
#[cfg(feature = "http-1")]
|
||||
use h2_0_4 as h2;
|
||||
|
||||
use h2::{
|
||||
server::{Connection, SendResponse},
|
||||
Ping, PingPong,
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
//! HTTP/2 protocol.
|
||||
#[cfg(feature = "http-1")]
|
||||
use h2_0_4 as h2;
|
||||
|
||||
use std::{
|
||||
future::Future,
|
||||
|
|
|
@ -28,6 +28,9 @@
|
|||
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]
|
||||
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
||||
|
||||
#[cfg(feature = "http-1")]
|
||||
extern crate http_1 as http;
|
||||
|
||||
pub use ::http::{uri, uri::Uri, Method, StatusCode, Version};
|
||||
|
||||
pub mod body;
|
||||
|
|
|
@ -10,6 +10,9 @@ use pin_project_lite::pin_project;
|
|||
|
||||
use crate::error::PayloadError;
|
||||
|
||||
#[cfg(feature = "http-1")]
|
||||
use h2_0_4 as h2;
|
||||
|
||||
/// A boxed payload stream.
|
||||
pub type BoxedPayloadStream = Pin<Box<dyn Stream<Item = Result<Bytes, PayloadError>>>>;
|
||||
|
||||
|
@ -54,8 +57,8 @@ impl<S> From<crate::h2::Payload> for Payload<S> {
|
|||
}
|
||||
|
||||
#[cfg(feature = "http2")]
|
||||
impl<S> From<::h2::RecvStream> for Payload<S> {
|
||||
fn from(stream: ::h2::RecvStream) -> Self {
|
||||
impl<S> From<h2::RecvStream> for Payload<S> {
|
||||
fn from(stream: h2::RecvStream) -> Self {
|
||||
Payload::H2 {
|
||||
payload: crate::h2::Payload::new(stream),
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
## Unreleased
|
||||
|
||||
- Minimum supported Rust version (MSRV) is now 1.68 due to transitive `time` dependency.
|
||||
- Added `http-1` feature for support to `http` v1.
|
||||
|
||||
## 0.5.1
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "actix-router"
|
||||
version = "0.5.1"
|
||||
version = "0.5.2"
|
||||
authors = [
|
||||
"Nikolay Kim <fafhrd91@gmail.com>",
|
||||
"Ali MJ Al-Nasrawy <alimjalnasrawy@gmail.com>",
|
||||
|
@ -19,16 +19,20 @@ path = "src/lib.rs"
|
|||
[features]
|
||||
default = ["http"]
|
||||
|
||||
# use http v1
|
||||
http-1 = ["dep:http-1"]
|
||||
|
||||
[dependencies]
|
||||
bytestring = ">=0.1.5, <2"
|
||||
http = { version = "0.2.7", optional = true }
|
||||
http = { version = "0.2", optional = true }
|
||||
http-1 = { package = "http", version = "1", optional = true }
|
||||
regex = "1.5"
|
||||
serde = "1"
|
||||
tracing = { version = "0.1.30", default-features = false, features = ["log"] }
|
||||
|
||||
[dev-dependencies]
|
||||
criterion = { version = "0.5", features = ["html_reports"] }
|
||||
http = "0.2.7"
|
||||
http = "0.2"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
percent-encoding = "2.1"
|
||||
|
||||
|
|
|
@ -15,10 +15,10 @@ mod resource;
|
|||
mod resource_path;
|
||||
mod router;
|
||||
|
||||
#[cfg(feature = "http")]
|
||||
#[cfg(any(feature = "http", feature = "http-1"))]
|
||||
mod url;
|
||||
|
||||
#[cfg(feature = "http")]
|
||||
#[cfg(any(feature = "http", feature = "http-1"))]
|
||||
pub use self::url::Url;
|
||||
pub use self::{
|
||||
de::PathDeserializer,
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
use crate::{Quoter, ResourcePath};
|
||||
|
||||
#[cfg(feature = "http-1")]
|
||||
use http_1 as http;
|
||||
|
||||
thread_local! {
|
||||
static DEFAULT_QUOTER: Quoter = Quoter::new(b"", b"%/+");
|
||||
}
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
|
||||
- Updated `zstd` dependency to `0.13`.
|
||||
- Compression middleware now prefers brotli over zstd over gzip.
|
||||
- Updated `actix-tls` dependency to `3.2`.
|
||||
- Added `http-1` feature for support to `http` crate version `1`.
|
||||
|
||||
### Fixed
|
||||
|
||||
|
|
|
@ -49,6 +49,11 @@ secure-cookies = ["cookies", "cookie/secure"]
|
|||
|
||||
http2 = ["actix-http/http2"]
|
||||
|
||||
http-1 = [
|
||||
"actix-http/http-1",
|
||||
"actix-router/http-1"
|
||||
]
|
||||
|
||||
# TLS via OpenSSL
|
||||
openssl = ["http2", "actix-http/openssl", "actix-tls/accept", "actix-tls/openssl"]
|
||||
|
||||
|
@ -73,10 +78,10 @@ actix-rt = { version = "2.6", default-features = false }
|
|||
actix-server = "2"
|
||||
actix-service = "2"
|
||||
actix-utils = "3"
|
||||
actix-tls = { version = "3.1", default-features = false, optional = true }
|
||||
actix-tls = { version = "3.1.1", default-features = false, optional = true }
|
||||
|
||||
actix-http = { version = "3.4", features = ["ws"] }
|
||||
actix-router = "0.5"
|
||||
actix-router = "0.5.2"
|
||||
actix-web-codegen = { version = "4.2", optional = true }
|
||||
|
||||
ahash = "0.8"
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
|
||||
- Update `trust-dns-resolver` dependency to `0.23`.
|
||||
- Updated `zstd` dependency to `0.13`.
|
||||
- Updated `actix-tls` dependency to `3.2`.
|
||||
- Added feature `http-1` for support to `http` crate version `1`.
|
||||
|
||||
## 3.2.0
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ path = "src/lib.rs"
|
|||
|
||||
[package.metadata.docs.rs]
|
||||
# features that docs.rs will build with
|
||||
features = ["openssl", "rustls-0_20", "rustls-0_21", "compress-brotli", "compress-gzip", "compress-zstd", "cookies"]
|
||||
features = ["openssl", "rustls-0_20", "rustls-0_21", "compress-brotli", "compress-gzip", "compress-zstd", "cookies", "http-0", "http-1"]
|
||||
|
||||
[features]
|
||||
default = ["compress-brotli", "compress-gzip", "compress-zstd", "cookies"]
|
||||
|
@ -58,12 +58,18 @@ __compress = []
|
|||
# DO NOT enable this over any internet use case.
|
||||
dangerous-h2c = []
|
||||
|
||||
http-1 = [
|
||||
"dep:http-1",
|
||||
"actix-http/http-1",
|
||||
"dep:h2-0_4",
|
||||
]
|
||||
|
||||
[dependencies]
|
||||
actix-codec = "0.5"
|
||||
actix-service = "2"
|
||||
actix-http = { version = "3.4", features = ["http2", "ws"] }
|
||||
actix-http = { version = "3.5", features = ["http2", "ws"] }
|
||||
actix-rt = { version = "2.1", default-features = false }
|
||||
actix-tls = { version = "3.1", features = ["connect", "uri"] }
|
||||
actix-tls = { version = "3.1.1", features = ["connect", "uri"] }
|
||||
actix-utils = "3"
|
||||
|
||||
base64 = "0.21"
|
||||
|
@ -72,8 +78,10 @@ cfg-if = "1"
|
|||
derive_more = "0.99.5"
|
||||
futures-core = { version = "0.3.17", default-features = false, features = ["alloc"] }
|
||||
futures-util = { version = "0.3.17", default-features = false, features = ["alloc", "sink"] }
|
||||
h2 = "0.3.17"
|
||||
http = "0.2.7"
|
||||
h2 = "0.3"
|
||||
h2-0_4 = { version = "0.4", package = "h2", optional = true }
|
||||
http = "0.2"
|
||||
http-1 = { package = "http", version = "1", optional = true }
|
||||
itoa = "1"
|
||||
log =" 0.4"
|
||||
mime = "0.3"
|
||||
|
@ -94,11 +102,11 @@ tls-rustls-0_21 = { package = "rustls", version = "0.21", optional = true, featu
|
|||
trust-dns-resolver = { version = "0.23", optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
actix-http = { version = "3.4", features = ["openssl"] }
|
||||
actix-http = { version = "3.5", features = ["openssl"] }
|
||||
actix-http-test = { version = "3", features = ["openssl"] }
|
||||
actix-server = "2"
|
||||
actix-test = { version = "0.1", features = ["openssl", "rustls-0_21"] }
|
||||
actix-tls = { version = "3", features = ["openssl", "rustls-0_21"] }
|
||||
actix-tls = { version = "3.1.1", features = ["openssl", "rustls-0_21"] }
|
||||
actix-utils = "3"
|
||||
actix-web = { version = "4", features = ["openssl"] }
|
||||
|
||||
|
|
|
@ -9,6 +9,9 @@ use actix_rt::net::{ActixStream, TcpStream};
|
|||
use actix_service::{boxed, Service};
|
||||
use base64::prelude::*;
|
||||
|
||||
#[cfg(feature = "http-1")]
|
||||
use http_1 as http;
|
||||
|
||||
use crate::{
|
||||
client::{
|
||||
ClientConfig, ConnectInfo, Connector, ConnectorService, TcpConnectError, TcpConnection,
|
||||
|
|
|
@ -11,6 +11,9 @@ use actix_http::{body::MessageBody, h1::ClientCodec, Payload, RequestHeadType, R
|
|||
use actix_rt::task::JoinHandle;
|
||||
use bytes::Bytes;
|
||||
use futures_core::future::LocalBoxFuture;
|
||||
#[cfg(feature = "http-1")]
|
||||
use http_1 as http;
|
||||
|
||||
use h2::client::SendRequest;
|
||||
|
||||
use super::{error::SendRequestError, h1proto, h2proto, pool::Acquired};
|
||||
|
|
|
@ -8,6 +8,9 @@ use std::{
|
|||
time::Duration,
|
||||
};
|
||||
|
||||
#[cfg(feature = "http-1")]
|
||||
use http_1 as http;
|
||||
|
||||
use actix_http::Protocol;
|
||||
use actix_rt::{
|
||||
net::{ActixStream, TcpStream},
|
||||
|
|
|
@ -4,6 +4,8 @@ use actix_http::error::{HttpError, ParseError};
|
|||
#[cfg(feature = "openssl")]
|
||||
use actix_tls::accept::openssl::reexports::Error as OpensslError;
|
||||
use derive_more::{Display, From};
|
||||
#[cfg(feature = "http-1")]
|
||||
use http_1 as http;
|
||||
|
||||
use crate::BoxError;
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ use actix_http::{
|
|||
};
|
||||
use actix_utils::future::poll_fn;
|
||||
use bytes::Bytes;
|
||||
|
||||
use h2::{
|
||||
client::{Builder, Connection, SendRequest},
|
||||
SendStream,
|
||||
|
@ -16,6 +17,9 @@ use http::{
|
|||
request::Request,
|
||||
Method, Version,
|
||||
};
|
||||
#[cfg(feature = "http-1")]
|
||||
use http_1 as http;
|
||||
|
||||
use log::trace;
|
||||
|
||||
use super::{
|
||||
|
|
|
@ -19,7 +19,11 @@ use actix_rt::time::{sleep, Sleep};
|
|||
use actix_service::Service;
|
||||
use futures_core::future::LocalBoxFuture;
|
||||
use futures_util::FutureExt as _;
|
||||
#[cfg(feature = "http-1")]
|
||||
use http_1 as http;
|
||||
|
||||
use http::uri::Authority;
|
||||
|
||||
use pin_project_lite::pin_project;
|
||||
use tokio::sync::{OwnedSemaphorePermit, Semaphore};
|
||||
|
||||
|
|
|
@ -112,6 +112,9 @@
|
|||
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]
|
||||
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
||||
|
||||
#[cfg(feature = "http-1")]
|
||||
extern crate h2_0_4 as h2;
|
||||
|
||||
pub use actix_http::body;
|
||||
#[cfg(feature = "cookies")]
|
||||
pub use cookie;
|
||||
|
|
Loading…
Reference in a new issue