mirror of
https://github.com/fafhrd91/actix-web
synced 2025-06-26 15:07:42 +02:00
apply standard formatting
This commit is contained in:
@ -4,11 +4,10 @@ use std::{
|
||||
task::{Context, Poll},
|
||||
};
|
||||
|
||||
use actix_http::body::{BodySize, BoxBody, MessageBody};
|
||||
use bytes::Bytes;
|
||||
use pin_project_lite::pin_project;
|
||||
|
||||
use actix_http::body::{BodySize, BoxBody, MessageBody};
|
||||
|
||||
pin_project! {
|
||||
/// Represents various types of HTTP message body.
|
||||
#[derive(Clone)]
|
||||
|
@ -1,7 +1,5 @@
|
||||
use std::{fmt, net::IpAddr, rc::Rc, time::Duration};
|
||||
|
||||
use base64::prelude::*;
|
||||
|
||||
use actix_http::{
|
||||
error::HttpError,
|
||||
header::{self, HeaderMap, HeaderName, TryIntoHeaderPair},
|
||||
@ -9,6 +7,7 @@ use actix_http::{
|
||||
};
|
||||
use actix_rt::net::{ActixStream, TcpStream};
|
||||
use actix_service::{boxed, Service};
|
||||
use base64::prelude::*;
|
||||
|
||||
use crate::{
|
||||
client::{
|
||||
@ -72,11 +71,8 @@ where
|
||||
/// Use custom connector service.
|
||||
pub fn connector<S1, Io1>(self, connector: Connector<S1>) -> ClientBuilder<S1, M>
|
||||
where
|
||||
S1: Service<
|
||||
ConnectInfo<Uri>,
|
||||
Response = TcpConnection<Uri, Io1>,
|
||||
Error = TcpConnectError,
|
||||
> + Clone
|
||||
S1: Service<ConnectInfo<Uri>, Response = TcpConnection<Uri, Io1>, Error = TcpConnectError>
|
||||
+ Clone
|
||||
+ 'static,
|
||||
Io1: ActixStream + fmt::Debug + 'static,
|
||||
{
|
||||
@ -227,10 +223,7 @@ where
|
||||
/// Registers middleware, in the form of a middleware component (type), that runs during inbound
|
||||
/// and/or outbound processing in the request life-cycle (request -> response),
|
||||
/// modifying request/response as necessary, across all requests managed by the `Client`.
|
||||
pub fn wrap<S1, M1>(
|
||||
self,
|
||||
mw: M1,
|
||||
) -> ClientBuilder<S, NestTransform<M, M1, S1, ConnectRequest>>
|
||||
pub fn wrap<S1, M1>(self, mw: M1) -> ClientBuilder<S, NestTransform<M, M1, S1, ConnectRequest>>
|
||||
where
|
||||
M: Transform<S1, ConnectRequest>,
|
||||
M1: Transform<M::Transform, ConnectRequest>,
|
||||
@ -253,8 +246,7 @@ where
|
||||
pub fn finish(self) -> Client
|
||||
where
|
||||
M: Transform<DefaultConnector<ConnectorService<S, Io>>, ConnectRequest> + 'static,
|
||||
M::Transform:
|
||||
Service<ConnectRequest, Response = ConnectResponse, Error = SendRequestError>,
|
||||
M::Transform: Service<ConnectRequest, Response = ConnectResponse, Error = SendRequestError>,
|
||||
{
|
||||
let max_redirects = self.max_redirects;
|
||||
|
||||
@ -269,8 +261,7 @@ where
|
||||
fn _finish(self) -> Client
|
||||
where
|
||||
M: Transform<DefaultConnector<ConnectorService<S, Io>>, ConnectRequest> + 'static,
|
||||
M::Transform:
|
||||
Service<ConnectRequest, Response = ConnectResponse, Error = SendRequestError>,
|
||||
M::Transform: Service<ConnectRequest, Response = ConnectResponse, Error = SendRequestError>,
|
||||
{
|
||||
let mut connector = self.connector;
|
||||
|
||||
|
@ -7,19 +7,15 @@ use std::{
|
||||
};
|
||||
|
||||
use actix_codec::{AsyncRead, AsyncWrite, Framed, ReadBuf};
|
||||
use actix_http::{body::MessageBody, h1::ClientCodec, Payload, RequestHeadType, ResponseHead};
|
||||
use actix_rt::task::JoinHandle;
|
||||
use bytes::Bytes;
|
||||
use futures_core::future::LocalBoxFuture;
|
||||
use h2::client::SendRequest;
|
||||
|
||||
use actix_http::{body::MessageBody, h1::ClientCodec, Payload, RequestHeadType, ResponseHead};
|
||||
|
||||
use super::{error::SendRequestError, h1proto, h2proto, pool::Acquired};
|
||||
use crate::BoxError;
|
||||
|
||||
use super::error::SendRequestError;
|
||||
use super::pool::Acquired;
|
||||
use super::{h1proto, h2proto};
|
||||
|
||||
/// Trait alias for types impl [tokio::io::AsyncRead] and [tokio::io::AsyncWrite].
|
||||
pub trait ConnectionIo: AsyncRead + AsyncWrite + Unpin + 'static {}
|
||||
|
||||
@ -83,10 +79,7 @@ impl<Io: ConnectionIo> AsyncWrite for H1Connection<Io> {
|
||||
self.io_pin_mut().poll_flush(cx)
|
||||
}
|
||||
|
||||
fn poll_shutdown(
|
||||
self: Pin<&mut Self>,
|
||||
cx: &mut Context<'_>,
|
||||
) -> Poll<Result<(), io::Error>> {
|
||||
fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), io::Error>> {
|
||||
self.io_pin_mut().poll_shutdown(cx)
|
||||
}
|
||||
|
||||
|
@ -133,11 +133,8 @@ impl<S> Connector<S> {
|
||||
pub fn connector<S1, Io1>(self, connector: S1) -> Connector<S1>
|
||||
where
|
||||
Io1: ActixStream + fmt::Debug + 'static,
|
||||
S1: Service<
|
||||
ConnectInfo<Uri>,
|
||||
Response = TcpConnection<Uri, Io1>,
|
||||
Error = TcpConnectError,
|
||||
> + Clone,
|
||||
S1: Service<ConnectInfo<Uri>, Response = TcpConnection<Uri, Io1>, Error = TcpConnectError>
|
||||
+ Clone,
|
||||
{
|
||||
Connector {
|
||||
connector,
|
||||
@ -189,10 +186,7 @@ where
|
||||
#[doc(hidden)]
|
||||
#[cfg(feature = "openssl")]
|
||||
#[deprecated(since = "3.0.0", note = "Renamed to `Connector::openssl`.")]
|
||||
pub fn ssl(
|
||||
mut self,
|
||||
connector: actix_tls::connect::openssl::reexports::SslConnector,
|
||||
) -> Self {
|
||||
pub fn ssl(mut self, connector: actix_tls::connect::openssl::reexports::SslConnector) -> Self {
|
||||
self.tls = OurTlsConnector::Openssl(connector);
|
||||
self
|
||||
}
|
||||
@ -312,9 +306,7 @@ where
|
||||
|
||||
let tls = match self.tls {
|
||||
#[cfg(feature = "openssl")]
|
||||
OurTlsConnector::OpensslBuilder(builder) => {
|
||||
OurTlsConnector::Openssl(builder.build())
|
||||
}
|
||||
OurTlsConnector::OpensslBuilder(builder) => OurTlsConnector::Openssl(builder.build()),
|
||||
tls => tls,
|
||||
};
|
||||
|
||||
@ -467,9 +459,7 @@ pub struct TcpConnectorService<S: Clone> {
|
||||
|
||||
impl<S, Io> Service<Connect> for TcpConnectorService<S>
|
||||
where
|
||||
S: Service<Connect, Response = TcpConnection<Uri, Io>, Error = ConnectError>
|
||||
+ Clone
|
||||
+ 'static,
|
||||
S: Service<Connect, Response = TcpConnection<Uri, Io>, Error = ConnectError> + Clone + 'static,
|
||||
{
|
||||
type Response = (Io, Protocol);
|
||||
type Error = ConnectError;
|
||||
@ -520,9 +510,8 @@ struct TlsConnectorService<Tcp, Tls> {
|
||||
|
||||
impl<Tcp, Tls, IO> Service<Connect> for TlsConnectorService<Tcp, Tls>
|
||||
where
|
||||
Tcp: Service<Connect, Response = TcpConnection<Uri, IO>, Error = ConnectError>
|
||||
+ Clone
|
||||
+ 'static,
|
||||
Tcp:
|
||||
Service<Connect, Response = TcpConnection<Uri, IO>, Error = ConnectError> + Clone + 'static,
|
||||
Tls: Service<TcpConnection<Uri, IO>, Error = std::io::Error> + Clone + 'static,
|
||||
Tls::Response: IntoConnectionIo,
|
||||
IO: ConnectionIo,
|
||||
|
@ -1,11 +1,9 @@
|
||||
use std::{fmt, io};
|
||||
|
||||
use derive_more::{Display, From};
|
||||
|
||||
use actix_http::error::{HttpError, ParseError};
|
||||
|
||||
#[cfg(feature = "openssl")]
|
||||
use actix_tls::accept::openssl::reexports::Error as OpensslError;
|
||||
use derive_more::{Display, From};
|
||||
|
||||
use crate::BoxError;
|
||||
|
||||
|
@ -18,12 +18,11 @@ use futures_core::{ready, Stream};
|
||||
use futures_util::SinkExt as _;
|
||||
use pin_project_lite::pin_project;
|
||||
|
||||
use crate::BoxError;
|
||||
|
||||
use super::{
|
||||
connection::{ConnectionIo, H1Connection},
|
||||
error::{ConnectError, SendRequestError},
|
||||
};
|
||||
use crate::BoxError;
|
||||
|
||||
pub(crate) async fn send_request<Io, B>(
|
||||
io: H1Connection<Io>,
|
||||
|
@ -1,28 +1,29 @@
|
||||
use std::future::Future;
|
||||
|
||||
use actix_utils::future::poll_fn;
|
||||
use bytes::Bytes;
|
||||
use h2::{
|
||||
client::{Builder, Connection, SendRequest},
|
||||
SendStream,
|
||||
};
|
||||
use http::header::{HeaderValue, CONNECTION, CONTENT_LENGTH, TRANSFER_ENCODING};
|
||||
use http::{request::Request, Method, Version};
|
||||
use log::trace;
|
||||
|
||||
use actix_http::{
|
||||
body::{BodySize, MessageBody},
|
||||
header::HeaderMap,
|
||||
Payload, RequestHeadType, ResponseHead,
|
||||
};
|
||||
|
||||
use crate::BoxError;
|
||||
use actix_utils::future::poll_fn;
|
||||
use bytes::Bytes;
|
||||
use h2::{
|
||||
client::{Builder, Connection, SendRequest},
|
||||
SendStream,
|
||||
};
|
||||
use http::{
|
||||
header::{HeaderValue, CONNECTION, CONTENT_LENGTH, TRANSFER_ENCODING},
|
||||
request::Request,
|
||||
Method, Version,
|
||||
};
|
||||
use log::trace;
|
||||
|
||||
use super::{
|
||||
config::ConnectorConfig,
|
||||
connection::{ConnectionIo, H2Connection},
|
||||
error::SendRequestError,
|
||||
};
|
||||
use crate::BoxError;
|
||||
|
||||
pub(crate) async fn send_request<Io, B>(
|
||||
mut io: H2Connection<Io>,
|
||||
|
@ -19,9 +19,11 @@ mod h1proto;
|
||||
mod h2proto;
|
||||
mod pool;
|
||||
|
||||
pub use self::connection::{Connection, ConnectionIo};
|
||||
pub use self::connector::{Connector, ConnectorService};
|
||||
pub use self::error::{ConnectError, FreezeRequestError, InvalidUrl, SendRequestError};
|
||||
pub use self::{
|
||||
connection::{Connection, ConnectionIo},
|
||||
connector::{Connector, ConnectorService},
|
||||
error::{ConnectError, FreezeRequestError, InvalidUrl, SendRequestError},
|
||||
};
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct Connect {
|
||||
|
@ -23,11 +23,13 @@ use http::uri::Authority;
|
||||
use pin_project_lite::pin_project;
|
||||
use tokio::sync::{OwnedSemaphorePermit, Semaphore};
|
||||
|
||||
use super::config::ConnectorConfig;
|
||||
use super::connection::{ConnectionInnerType, ConnectionIo, ConnectionType, H2ConnectionInner};
|
||||
use super::error::ConnectError;
|
||||
use super::h2proto::handshake;
|
||||
use super::Connect;
|
||||
use super::{
|
||||
config::ConnectorConfig,
|
||||
connection::{ConnectionInnerType, ConnectionIo, ConnectionType, H2ConnectionInner},
|
||||
error::ConnectError,
|
||||
h2proto::handshake,
|
||||
Connect,
|
||||
};
|
||||
|
||||
#[derive(Hash, Eq, PartialEq, Clone, Debug)]
|
||||
pub struct Key {
|
||||
@ -201,7 +203,9 @@ where
|
||||
// check if the connection is still usable
|
||||
if let ConnectionInnerType::H1(ref mut io) = c.conn {
|
||||
let check = ConnectionCheckFuture { io };
|
||||
match check.now_or_never().expect("ConnectionCheckFuture must never yield with Poll::Pending.") {
|
||||
match check.now_or_never().expect(
|
||||
"ConnectionCheckFuture must never yield with Poll::Pending.",
|
||||
) {
|
||||
ConnectionState::Tainted => {
|
||||
inner.close(c.conn);
|
||||
continue;
|
||||
|
@ -13,9 +13,7 @@ use futures_core::{future::LocalBoxFuture, ready};
|
||||
|
||||
use crate::{
|
||||
any_body::AnyBody,
|
||||
client::{
|
||||
Connect as ClientConnect, ConnectError, Connection, ConnectionIo, SendRequestError,
|
||||
},
|
||||
client::{Connect as ClientConnect, ConnectError, Connection, ConnectionIo, SendRequestError},
|
||||
ClientResponse,
|
||||
};
|
||||
|
||||
@ -62,9 +60,9 @@ impl ConnectResponse {
|
||||
pub fn into_client_response(self) -> ClientResponse {
|
||||
match self {
|
||||
ConnectResponse::Client(res) => res,
|
||||
_ => panic!(
|
||||
"ClientResponse only reachable with ConnectResponse::ClientResponse variant"
|
||||
),
|
||||
_ => {
|
||||
panic!("ClientResponse only reachable with ConnectResponse::ClientResponse variant")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -75,9 +73,9 @@ impl ConnectResponse {
|
||||
pub fn into_tunnel_response(self) -> (ResponseHead, Framed<BoxedSocket, ClientCodec>) {
|
||||
match self {
|
||||
ConnectResponse::Tunnel(head, framed) => (head, framed),
|
||||
_ => panic!(
|
||||
"TunnelResponse only reachable with ConnectResponse::TunnelResponse variant"
|
||||
),
|
||||
_ => {
|
||||
panic!("TunnelResponse only reachable with ConnectResponse::TunnelResponse variant")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,6 @@ pub use actix_http::{
|
||||
ws::{HandshakeError as WsHandshakeError, ProtocolError as WsProtocolError},
|
||||
StatusCode,
|
||||
};
|
||||
|
||||
use derive_more::{Display, From};
|
||||
use serde_json::error::Error as JsonError;
|
||||
|
||||
|
@ -1,15 +1,14 @@
|
||||
use std::{net, rc::Rc, time::Duration};
|
||||
|
||||
use bytes::Bytes;
|
||||
use futures_core::Stream;
|
||||
use serde::Serialize;
|
||||
|
||||
use actix_http::{
|
||||
body::MessageBody,
|
||||
error::HttpError,
|
||||
header::{HeaderMap, TryIntoHeaderPair},
|
||||
Method, RequestHead, Uri,
|
||||
};
|
||||
use bytes::Bytes;
|
||||
use futures_core::Stream;
|
||||
use serde::Serialize;
|
||||
|
||||
use crate::{
|
||||
client::ClientConfig,
|
||||
|
@ -113,7 +113,6 @@
|
||||
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
||||
|
||||
pub use actix_http::body;
|
||||
|
||||
#[cfg(feature = "cookies")]
|
||||
pub use cookie;
|
||||
|
||||
@ -134,18 +133,18 @@ pub mod http {
|
||||
//! Various HTTP related types.
|
||||
|
||||
// TODO: figure out how best to expose http::Error vs actix_http::Error
|
||||
pub use actix_http::{
|
||||
header, uri, ConnectionType, Error, Method, StatusCode, Uri, Version,
|
||||
};
|
||||
pub use actix_http::{header, uri, ConnectionType, Error, Method, StatusCode, Uri, Version};
|
||||
}
|
||||
|
||||
pub use self::builder::ClientBuilder;
|
||||
pub use self::client::{Client, Connect, Connector};
|
||||
pub use self::connect::{BoxConnectorService, BoxedSocket, ConnectRequest, ConnectResponse};
|
||||
pub use self::frozen::{FrozenClientRequest, FrozenSendBuilder};
|
||||
pub use self::request::ClientRequest;
|
||||
#[allow(deprecated)]
|
||||
pub use self::responses::{ClientResponse, JsonBody, MessageBody, ResponseBody};
|
||||
pub use self::sender::SendClientRequest;
|
||||
pub use self::{
|
||||
builder::ClientBuilder,
|
||||
client::{Client, Connect, Connector},
|
||||
connect::{BoxConnectorService, BoxedSocket, ConnectRequest, ConnectResponse},
|
||||
frozen::{FrozenClientRequest, FrozenSendBuilder},
|
||||
request::ClientRequest,
|
||||
sender::SendClientRequest,
|
||||
};
|
||||
|
||||
pub(crate) type BoxError = Box<dyn std::error::Error>;
|
||||
|
@ -1,11 +1,11 @@
|
||||
mod redirect;
|
||||
|
||||
pub use self::redirect::Redirect;
|
||||
|
||||
use std::marker::PhantomData;
|
||||
|
||||
use actix_service::Service;
|
||||
|
||||
pub use self::redirect::Redirect;
|
||||
|
||||
/// Trait for transform a type to another one.
|
||||
/// Both the input and output type should impl [actix_service::Service] trait.
|
||||
pub trait Transform<S, Req> {
|
||||
|
@ -449,8 +449,7 @@ mod tests {
|
||||
}
|
||||
|
||||
async fn test(req: HttpRequest, body: Bytes) -> HttpResponse {
|
||||
if (req.method() == Method::GET || req.method() == Method::HEAD)
|
||||
&& body.is_empty()
|
||||
if (req.method() == Method::GET || req.method() == Method::HEAD) && body.is_empty()
|
||||
{
|
||||
HttpResponse::Ok().finish()
|
||||
} else {
|
||||
@ -550,10 +549,7 @@ mod tests {
|
||||
let port = *req.app_data::<u16>().unwrap();
|
||||
if req.headers().get(header::AUTHORIZATION).is_some() {
|
||||
HttpResponse::Found()
|
||||
.append_header((
|
||||
"location",
|
||||
format!("http://localhost:{}/", port).as_str(),
|
||||
))
|
||||
.append_header(("location", format!("http://localhost:{}/", port).as_str()))
|
||||
.finish()
|
||||
} else {
|
||||
HttpResponse::InternalServerError().finish()
|
||||
|
@ -1,17 +1,18 @@
|
||||
use std::{fmt, net, rc::Rc, time::Duration};
|
||||
|
||||
use base64::prelude::*;
|
||||
use bytes::Bytes;
|
||||
use futures_core::Stream;
|
||||
use serde::Serialize;
|
||||
|
||||
use actix_http::{
|
||||
body::MessageBody,
|
||||
error::HttpError,
|
||||
header::{self, HeaderMap, HeaderValue, TryIntoHeaderPair},
|
||||
ConnectionType, Method, RequestHead, Uri, Version,
|
||||
};
|
||||
use base64::prelude::*;
|
||||
use bytes::Bytes;
|
||||
use futures_core::Stream;
|
||||
use serde::Serialize;
|
||||
|
||||
#[cfg(feature = "cookies")]
|
||||
use crate::cookie::{Cookie, CookieJar};
|
||||
use crate::{
|
||||
client::ClientConfig,
|
||||
error::{FreezeRequestError, InvalidUrl},
|
||||
@ -20,9 +21,6 @@ use crate::{
|
||||
BoxError,
|
||||
};
|
||||
|
||||
#[cfg(feature = "cookies")]
|
||||
use crate::cookie::{Cookie, CookieJar};
|
||||
|
||||
/// An HTTP Client request builder
|
||||
///
|
||||
/// This type can be used to construct an instance of `ClientRequest` through a
|
||||
@ -291,10 +289,7 @@ impl ClientRequest {
|
||||
}
|
||||
|
||||
/// Sets the query part of the request
|
||||
pub fn query<T: Serialize>(
|
||||
mut self,
|
||||
query: &T,
|
||||
) -> Result<Self, serde_urlencoded::ser::Error> {
|
||||
pub fn query<T: Serialize>(mut self, query: &T) -> Result<Self, serde_urlencoded::ser::Error> {
|
||||
let mut parts = self.head.uri.clone().into_parts();
|
||||
|
||||
if let Some(path_and_query) = parts.path_and_query {
|
||||
|
@ -8,10 +8,9 @@ mod read_body;
|
||||
mod response;
|
||||
mod response_body;
|
||||
|
||||
pub use self::json_body::JsonBody;
|
||||
pub use self::response::ClientResponse;
|
||||
#[allow(deprecated)]
|
||||
pub use self::response_body::{MessageBody, ResponseBody};
|
||||
pub use self::{json_body::JsonBody, response::ClientResponse};
|
||||
|
||||
/// Default body size limit: 2 MiB
|
||||
const DEFAULT_BODY_LIMIT: usize = 2 * 1024 * 1024;
|
||||
|
@ -7,8 +7,8 @@ use std::{
|
||||
};
|
||||
|
||||
use actix_http::{
|
||||
error::PayloadError, header::HeaderMap, BoxedPayloadStream, Extensions, HttpMessage,
|
||||
Payload, ResponseHead, StatusCode, Version,
|
||||
error::PayloadError, header::HeaderMap, BoxedPayloadStream, Extensions, HttpMessage, Payload,
|
||||
ResponseHead, StatusCode, Version,
|
||||
};
|
||||
use actix_rt::time::{sleep, Sleep};
|
||||
use bytes::Bytes;
|
||||
@ -16,11 +16,10 @@ use futures_core::Stream;
|
||||
use pin_project_lite::pin_project;
|
||||
use serde::de::DeserializeOwned;
|
||||
|
||||
use super::{JsonBody, ResponseBody, ResponseTimeout};
|
||||
#[cfg(feature = "cookies")]
|
||||
use crate::cookie::{Cookie, ParseError as CookieParseError};
|
||||
|
||||
use super::{JsonBody, ResponseBody, ResponseTimeout};
|
||||
|
||||
pin_project! {
|
||||
/// Client Response
|
||||
pub struct ClientResponse<S = BoxedPayloadStream> {
|
||||
|
@ -13,15 +13,14 @@ use actix_http::{
|
||||
header::{self, HeaderMap, HeaderName, TryIntoHeaderValue},
|
||||
RequestHead, RequestHeadType,
|
||||
};
|
||||
#[cfg(feature = "__compress")]
|
||||
use actix_http::{encoding::Decoder, header::ContentEncoding, Payload};
|
||||
use actix_rt::time::{sleep, Sleep};
|
||||
use bytes::Bytes;
|
||||
use derive_more::From;
|
||||
use futures_core::Stream;
|
||||
use serde::Serialize;
|
||||
|
||||
#[cfg(feature = "__compress")]
|
||||
use actix_http::{encoding::Decoder, header::ContentEncoding, Payload};
|
||||
|
||||
use crate::{
|
||||
any_body::AnyBody,
|
||||
client::ClientConfig,
|
||||
@ -106,8 +105,9 @@ impl Future for SendClientRequest {
|
||||
}
|
||||
|
||||
let res = futures_core::ready!(send.as_mut().poll(cx)).map(|res| {
|
||||
res.into_client_response()._timeout(delay.take()).map_body(
|
||||
|head, payload| {
|
||||
res.into_client_response()
|
||||
._timeout(delay.take())
|
||||
.map_body(|head, payload| {
|
||||
if *response_decompress {
|
||||
Payload::Stream {
|
||||
payload: Decoder::from_headers(payload, &head.headers),
|
||||
@ -117,8 +117,7 @@ impl Future for SendClientRequest {
|
||||
payload: Decoder::new(payload, ContentEncoding::Identity),
|
||||
}
|
||||
}
|
||||
},
|
||||
)
|
||||
})
|
||||
});
|
||||
|
||||
Poll::Ready(res)
|
||||
|
@ -28,15 +28,15 @@
|
||||
|
||||
use std::{fmt, net::SocketAddr, str};
|
||||
|
||||
use base64::prelude::*;
|
||||
|
||||
use actix_codec::Framed;
|
||||
pub use actix_http::ws::{CloseCode, CloseReason, Codec, Frame, Message};
|
||||
use actix_http::{ws, Payload, RequestHead};
|
||||
use actix_rt::time::timeout;
|
||||
use actix_service::Service as _;
|
||||
use base64::prelude::*;
|
||||
|
||||
pub use actix_http::ws::{CloseCode, CloseReason, Codec, Frame, Message};
|
||||
|
||||
#[cfg(feature = "cookies")]
|
||||
use crate::cookie::{Cookie, CookieJar};
|
||||
use crate::{
|
||||
client::ClientConfig,
|
||||
connect::{BoxedSocket, ConnectRequest},
|
||||
@ -48,9 +48,6 @@ use crate::{
|
||||
ClientResponse,
|
||||
};
|
||||
|
||||
#[cfg(feature = "cookies")]
|
||||
use crate::cookie::{Cookie, CookieJar};
|
||||
|
||||
/// WebSocket connection.
|
||||
pub struct WebsocketsRequest {
|
||||
pub(crate) head: RequestHead,
|
||||
|
Reference in New Issue
Block a user