1
0
mirror of https://github.com/fafhrd91/actix-web synced 2024-11-27 09:42:57 +01:00

bump actix dependency to v0.10 (#1666)

This commit is contained in:
Rob Ede 2020-09-11 12:09:52 +01:00 committed by GitHub
parent cf5138e740
commit bf53fe5a22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 56 additions and 54 deletions

View File

@ -102,7 +102,8 @@ 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]
actix = "0.10.0-alpha.1" actix = "0.10.0"
actix-http = { version = "2.0.0-beta.4", features = ["actors"] }
rand = "0.7" rand = "0.7"
env_logger = "0.7" env_logger = "0.7"
serde_derive = "1.0" serde_derive = "1.0"

View File

@ -47,7 +47,7 @@ actix-utils = "2.0.0"
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", optional = true } actix-tls = { version = "2.0.0", optional = true }
actix = { version = "0.10.0-alpha.1", optional = true } actix = { version = "0.10.0", optional = true }
base64 = "0.12" base64 = "0.12"
bitflags = "1.2" bitflags = "1.2"

View File

@ -283,11 +283,11 @@ impl DispositionParam {
/// Some("\u{1f600}.svg".as_bytes())); /// Some("\u{1f600}.svg".as_bytes()));
/// ``` /// ```
/// ///
/// # WARN /// # Security Note
///
/// If "filename" parameter is supplied, do not use the file name blindly, check and possibly /// If "filename" parameter is supplied, do not use the file name blindly, check and possibly
/// change to match local file system conventions if applicable, and do not use directory path /// change to match local file system conventions if applicable, and do not use directory path
/// information that may be present. See [RFC2183](https://tools.ietf.org/html/rfc2183#section-2.3) /// information that may be present. See [RFC2183](https://tools.ietf.org/html/rfc2183#section-2.3).
/// .
#[derive(Clone, Debug, PartialEq)] #[derive(Clone, Debug, PartialEq)]
pub struct ContentDisposition { pub struct ContentDisposition {
/// The disposition type /// The disposition type

View File

@ -16,7 +16,7 @@ name = "actix_web_actors"
path = "src/lib.rs" path = "src/lib.rs"
[dependencies] [dependencies]
actix = "0.10.0-alpha.2" actix = "0.10.0"
actix-web = { version = "3.0.0-beta.4", default-features = false } actix-web = { version = "3.0.0-beta.4", default-features = false }
actix-http = "2.0.0-beta.4" actix-http = "2.0.0-beta.4"
actix-codec = "0.3.0" actix-codec = "0.3.0"

View File

@ -59,7 +59,7 @@
//! * Middlewares ([Logger, Session, CORS, etc](https://actix.rs/docs/middleware/)) //! * 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) //! * Includes an async [HTTP client](https://actix.rs/actix-web/actix_web/client/index.html)
//! * Supports [Actix actor framework](https://github.com/actix/actix) //! * Supports [Actix actor framework](https://github.com/actix/actix)
//! * Runs on stable Rust 1.41+ //! * Runs on stable Rust 1.42+
//! //!
//! ## Crate Features //! ## Crate Features
//! //!

View File

@ -1281,53 +1281,54 @@ mod tests {
assert!(res.status().is_success()); assert!(res.status().is_success());
} }
/*
Comment out until actix decoupled of actix-http:
https://github.com/actix/actix/issues/321
use futures::FutureExt;
#[actix_rt::test] #[actix_rt::test]
async fn test_actor() { async fn test_actor() {
use actix::Actor; use crate::Error;
use actix::prelude::*;
struct MyActor; struct MyActor;
impl Actor for MyActor {
type Context = Context<Self>;
}
struct Num(usize); struct Num(usize);
impl actix::Message for Num {
impl Message for Num {
type Result = usize; type Result = usize;
} }
impl actix::Actor for MyActor {
type Context = actix::Context<Self>; impl Handler<Num> for MyActor {
}
impl actix::Handler<Num> for MyActor {
type Result = usize; type Result = usize;
fn handle(&mut self, msg: Num, _: &mut Self::Context) -> Self::Result { fn handle(&mut self, msg: Num, _: &mut Self::Context) -> Self::Result {
msg.0 msg.0
} }
} }
let addr = MyActor.start();
async fn actor_handler(
addr: Data<Addr<MyActor>>,
) -> Result<impl Responder, Error> {
// `?` operator tests "actors" feature flag on actix-http
let res = addr.send(Num(1)).await?;
let mut app = init_service(App::new().service(web::resource("/index.html").to(
move || {
addr.send(Num(1)).map(|res| match res {
Ok(res) => {
if res == 1 { if res == 1 {
Ok(HttpResponse::Ok()) Ok(HttpResponse::Ok())
} else { } else {
Ok(HttpResponse::BadRequest()) Ok(HttpResponse::BadRequest())
} }
} }
Err(err) => Err(err),
})
},
)))
.await;
let req = TestRequest::post().uri("/index.html").to_request(); let srv = App::new()
.data(addr.clone())
.service(web::resource("/").to(actor_handler));
let mut app = init_service(srv).await;
let req = TestRequest::post().uri("/").to_request();
let res = app.call(req).await.unwrap(); let res = app.call(req).await.unwrap();
assert!(res.status().is_success()); assert!(res.status().is_success());
} }
*/
} }