Update to actix-web 4 beta 3
This commit is contained in:
parent
839ba65ee9
commit
9cc2cea743
11
Cargo.toml
11
Cargo.toml
|
@ -1,7 +1,7 @@
|
|||
[package]
|
||||
name = "actix-form-data"
|
||||
description = "Multipart Form Data for Actix Web"
|
||||
version = "0.5.0"
|
||||
version = "0.6.0-beta.1"
|
||||
license = "GPL-3.0"
|
||||
authors = ["asonix <asonix@asonix.dog>"]
|
||||
repository = "https://git.asonix.dog/Aardwolf/actix-form-data.git"
|
||||
|
@ -10,14 +10,13 @@ keywords = ["actix", "form-data", "multipart", "async"]
|
|||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
actix-multipart = "0.3.0"
|
||||
actix-rt = "1.1.1"
|
||||
actix-web = "3.0.1"
|
||||
bytes = "0.5.0"
|
||||
actix-multipart = "0.4.0-beta.2"
|
||||
actix-rt = "2.0.2"
|
||||
actix-web = "4.0.0-beta.3"
|
||||
futures = "0.3.4"
|
||||
mime = "0.3.16"
|
||||
thiserror = "1.0"
|
||||
tokio = { version = "0.2.21", features = ["sync"] }
|
||||
tokio = { version = "1", features = ["sync"] }
|
||||
tracing = "0.1.15"
|
||||
|
||||
[dev-dependencies]
|
||||
|
|
|
@ -2,10 +2,9 @@ use actix_form_data::{Error, Field, Form, Value};
|
|||
use actix_web::{
|
||||
http::StatusCode,
|
||||
middleware::Logger,
|
||||
web::{post, resource},
|
||||
web::{post, resource, Bytes},
|
||||
App, HttpResponse, HttpServer, ResponseError,
|
||||
};
|
||||
use bytes::Bytes;
|
||||
use futures::stream::{Stream, StreamExt, TryStreamExt};
|
||||
use std::{
|
||||
env,
|
||||
|
|
|
@ -58,12 +58,11 @@ impl FromRequest for Value {
|
|||
}
|
||||
}
|
||||
|
||||
impl<S> Transform<S> for Form
|
||||
impl<S> Transform<S, ServiceRequest> for Form
|
||||
where
|
||||
S: Service<Request = ServiceRequest, Error = actix_web::Error>,
|
||||
S: Service<ServiceRequest, Error = actix_web::Error>,
|
||||
S::Future: 'static,
|
||||
{
|
||||
type Request = S::Request;
|
||||
type Response = S::Response;
|
||||
type Error = S::Error;
|
||||
type InitError = ();
|
||||
|
@ -78,21 +77,20 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
impl<S> Service for MultipartMiddleware<S>
|
||||
impl<S> Service<ServiceRequest> for MultipartMiddleware<S>
|
||||
where
|
||||
S: Service<Request = ServiceRequest, Error = actix_web::Error>,
|
||||
S: Service<ServiceRequest, Error = actix_web::Error>,
|
||||
S::Future: 'static,
|
||||
{
|
||||
type Request = S::Request;
|
||||
type Response = S::Response;
|
||||
type Error = S::Error;
|
||||
type Future = Pin<Box<dyn Future<Output = Result<S::Response, S::Error>>>>;
|
||||
|
||||
fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
|
||||
fn poll_ready(&self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
|
||||
self.service.poll_ready(cx)
|
||||
}
|
||||
|
||||
fn call(&mut self, mut req: S::Request) -> Self::Future {
|
||||
fn call(&self, mut req: ServiceRequest) -> Self::Future {
|
||||
let (tx, rx) = channel();
|
||||
req.extensions_mut().insert(Uploaded { rx });
|
||||
let payload = req.take_payload();
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
|
||||
use crate::Error;
|
||||
use bytes::Bytes;
|
||||
use actix_web::web::Bytes;
|
||||
use futures::Stream;
|
||||
use mime::Mime;
|
||||
use std::{
|
||||
|
|
|
@ -24,7 +24,7 @@ use crate::{
|
|||
MultipartForm, MultipartHash, NamePart, Value,
|
||||
},
|
||||
};
|
||||
use bytes::BytesMut;
|
||||
use actix_web::web::BytesMut;
|
||||
use futures::{
|
||||
select,
|
||||
stream::{FuturesUnordered, StreamExt},
|
||||
|
|
Loading…
Reference in New Issue