From 8de183768c6297f77e741e0fe8adb968a1c74375 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Sat, 4 May 2019 21:52:24 -0700 Subject: [PATCH] upgrade to beta3 --- actix_redis/Cargo.toml | 4 ++-- actix_todo/Cargo.toml | 6 +++--- async_db/Cargo.toml | 2 +- basics/Cargo.toml | 6 +++--- cookie-auth/Cargo.toml | 2 +- cookie-session/Cargo.toml | 4 ++-- diesel/Cargo.toml | 2 +- diesel/src/main.rs | 30 ++++++++++++++---------------- error_handling/Cargo.toml | 2 +- form/Cargo.toml | 2 +- hello-world/Cargo.toml | 2 +- http-full-proxy/Cargo.toml | 2 +- http-proxy/Cargo.toml | 2 +- json/Cargo.toml | 2 +- json/src/main.rs | 17 +++++------------ jsonrpc/Cargo.toml | 4 ++-- juniper/Cargo.toml | 2 +- middleware/Cargo.toml | 2 +- multipart/Cargo.toml | 2 +- multipart/src/main.rs | 9 ++++----- protobuf/Cargo.toml | 2 +- r2d2/Cargo.toml | 2 +- redis-session/Cargo.toml | 6 +++--- simple-auth-server/Cargo.toml | 2 +- state/Cargo.toml | 2 +- static_index/Cargo.toml | 4 ++-- template_askama/Cargo.toml | 2 +- template_tera/Cargo.toml | 2 +- template_yarte/Cargo.toml | 2 +- web-cors/backend/Cargo.toml | 2 +- websocket-chat/Cargo.toml | 8 ++++---- websocket-tcp-chat/Cargo.toml | 6 +++--- websocket/Cargo.toml | 6 +++--- 33 files changed, 70 insertions(+), 80 deletions(-) diff --git a/actix_redis/Cargo.toml b/actix_redis/Cargo.toml index 7229262f..bbc6f438 100644 --- a/actix_redis/Cargo.toml +++ b/actix_redis/Cargo.toml @@ -6,8 +6,8 @@ edition = "2018" workspace = ".." [dependencies] -actix = "0.8.0-alpha.2" -actix-web = "1.0.0-alpha.4" +actix = "0.8.1" +actix-web = "1.0.0-beta.3" actix-redis = { git="https://github.com/actix/actix-redis.git" } futures = "0.1.23" redis-async = "0.4.0" diff --git a/actix_todo/Cargo.toml b/actix_todo/Cargo.toml index 6e3acb91..3fae6884 100644 --- a/actix_todo/Cargo.toml +++ b/actix_todo/Cargo.toml @@ -6,9 +6,9 @@ workspace = ".." edition = "2018" [dependencies] -actix-web = "1.0.0-alpha.4" -actix-files = "0.1.0-alpha.4" -actix-session = "0.1.0-alpha.4" +actix-web = "1.0.0-beta.3" +actix-files = "0.1.0-beta.1" +actix-session = "0.1.0-beta.2" dotenv = "0.13.0" env_logger = "0.5.10" futures = "0.1.22" diff --git a/async_db/Cargo.toml b/async_db/Cargo.toml index 8063ead8..3c73fc49 100644 --- a/async_db/Cargo.toml +++ b/async_db/Cargo.toml @@ -7,7 +7,7 @@ workspace = ".." [dependencies] actix-rt = "0.2" -actix-web = "1.0.0-alpha.4" +actix-web = "1.0.0-beta.3" dotenv = "0.10" env_logger = "0.5" diff --git a/basics/Cargo.toml b/basics/Cargo.toml index e16db24a..2a27e7c6 100644 --- a/basics/Cargo.toml +++ b/basics/Cargo.toml @@ -7,9 +7,9 @@ edition = "2018" [dependencies] actix-rt = "0.2" -actix-web = "1.0.0-alpha.4" -actix-files = "0.1.0-alpha.4" -actix-session = "0.1.0-alpha.4" +actix-web = "1.0.0-beta.3" +actix-files = "0.1.0-beta.1" +actix-session = "0.1.0-beta.2" futures = "0.1.25" env_logger = "0.5" diff --git a/cookie-auth/Cargo.toml b/cookie-auth/Cargo.toml index 66d02b61..34897fd8 100644 --- a/cookie-auth/Cargo.toml +++ b/cookie-auth/Cargo.toml @@ -6,5 +6,5 @@ edition = "2018" workspace = ".." [dependencies] -actix-web = "1.0.0-alpha.4" +actix-web = "1.0.0-beta.3" env_logger = "0.6" diff --git a/cookie-session/Cargo.toml b/cookie-session/Cargo.toml index 2a76fa63..ed47386c 100644 --- a/cookie-session/Cargo.toml +++ b/cookie-session/Cargo.toml @@ -6,8 +6,8 @@ workspace = ".." edition = "2018" [dependencies] -actix-web = "1.0.0-alpha.4" -actix-session = "0.1.0-alpha.4" +actix-web = "1.0.0-beta.3" +actix-session = "0.1.0-beta.2" futures = "0.1" time = "0.1" diff --git a/diesel/Cargo.toml b/diesel/Cargo.toml index 5c534ced..47237609 100644 --- a/diesel/Cargo.toml +++ b/diesel/Cargo.toml @@ -6,7 +6,7 @@ workspace = ".." edition = "2018" [dependencies] -actix-web = "1.0.0-alpha.4" +actix-web = "1.0.0-beta.3" bytes = "0.4" env_logger = "0.6" diff --git a/diesel/src/main.rs b/diesel/src/main.rs index fdf3cbc4..80dbc8b4 100644 --- a/diesel/src/main.rs +++ b/diesel/src/main.rs @@ -137,22 +137,20 @@ fn main() -> std::io::Result<()> { // Use of the extractors makes some post conditions simpler such // as size limit protections and built in json validation. .service( - web::resource("/add2").route( - web::post() - .data( - web::JsonConfig::default() - .limit(4096) // <- limit size of the payload - .error_handler(|err, _| { - // <- create custom error response - error::InternalError::from_response( - err, - HttpResponse::Conflict().finish(), - ) - .into() - }), - ) - .to_async(add2), - ), + web::resource("/add2") + .data( + web::JsonConfig::default() + .limit(4096) // <- limit size of the payload + .error_handler(|err, _| { + // <- create custom error response + error::InternalError::from_response( + err, + HttpResponse::Conflict().finish(), + ) + .into() + }), + ) + .route(web::post().to_async(add2)), ) // Manual parsing would allow custom error construction, use of // other parsers *beside* json (for example CBOR, protobuf, xml), and allows diff --git a/error_handling/Cargo.toml b/error_handling/Cargo.toml index 9e0b003f..ef3c168f 100644 --- a/error_handling/Cargo.toml +++ b/error_handling/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" workspace = ".." [dependencies] -actix-web = "1.0.0-alpha.4" +actix-web = "1.0.0-beta.3" derive_more = "0.14.0" futures = "0.1.23" diff --git a/form/Cargo.toml b/form/Cargo.toml index 1f983684..c2fdcbfa 100644 --- a/form/Cargo.toml +++ b/form/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" workspace = ".." [dependencies] -actix-web = "1.0.0-alpha.4" +actix-web = "1.0.0-beta.3" serde = "1.0" serde_derive = "1.0" diff --git a/hello-world/Cargo.toml b/hello-world/Cargo.toml index 733faa54..8176a1fc 100644 --- a/hello-world/Cargo.toml +++ b/hello-world/Cargo.toml @@ -6,5 +6,5 @@ workspace = ".." edition = "2018" [dependencies] -actix-web = "1.0.0-alpha.4" +actix-web = "1.0.0-beta.3" env_logger = "0.6" diff --git a/http-full-proxy/Cargo.toml b/http-full-proxy/Cargo.toml index 5e7f4f75..21383f37 100644 --- a/http-full-proxy/Cargo.toml +++ b/http-full-proxy/Cargo.toml @@ -7,7 +7,7 @@ edition = "2018" [dependencies] actix-rt = "0.2" -actix-web = "1.0.0-alpha.5" +actix-web = "1.0.0-beta.3" clap = "2.32.0" futures = "0.1.25" diff --git a/http-proxy/Cargo.toml b/http-proxy/Cargo.toml index 9afc29ea..5cb4a0e2 100644 --- a/http-proxy/Cargo.toml +++ b/http-proxy/Cargo.toml @@ -15,7 +15,7 @@ path = "src/server.rs" [dependencies] actix-rt = "0.2" -actix-web = "1.0.0-alpha.4" +actix-web = "1.0.0-beta.3" env_logger = "0.5" futures = "0.1" diff --git a/json/Cargo.toml b/json/Cargo.toml index eab6ddb7..207cc609 100644 --- a/json/Cargo.toml +++ b/json/Cargo.toml @@ -6,7 +6,7 @@ workspace = ".." edition = "2018" [dependencies] -actix-web = "1.0.0-alpha.4" +actix-web = "1.0.0-beta.3" bytes = "0.4" futures = "0.1" diff --git a/json/src/main.rs b/json/src/main.rs index 9b0d9a57..86f2a242 100644 --- a/json/src/main.rs +++ b/json/src/main.rs @@ -83,19 +83,12 @@ fn main() -> std::io::Result<()> { App::new() // enable logger .wrap(middleware::Logger::default()) + .data(web::JsonConfig::default().limit(4096)) // <- limit size of the payload (global configuration) + .service(web::resource("/extractor").route(web::post().to(index))) .service( - web::resource("/extractor").route( - web::post() - .data(web::JsonConfig::default().limit(4096)) // <- limit size of the payload - .to(index), - ), - ) - .service( - web::resource("/extractor2").route( - web::post() - .data(web::JsonConfig::default().limit(4096)) // <- limit size of the payload - .to_async(extract_item), - ), + web::resource("/extractor2") + .data(web::JsonConfig::default().limit(1024)) // <- limit size of the payload (resource level) + .route(web::post().to_async(extract_item)), ) .service(web::resource("/manual").route(web::post().to_async(index_manual))) .service( diff --git a/jsonrpc/Cargo.toml b/jsonrpc/Cargo.toml index 65410619..720f44a7 100644 --- a/jsonrpc/Cargo.toml +++ b/jsonrpc/Cargo.toml @@ -6,8 +6,8 @@ edition = "2018" workspace = ".." [dependencies] -actix = "0.8.0-alpha.2" -actix-web = "1.0.0-alpha.4" +actix = "0.8.1" +actix-web = "1.0.0-beta.3" env_logger = "0.6" futures = "0.1.23" futures-timer = "0.1" diff --git a/juniper/Cargo.toml b/juniper/Cargo.toml index 71f410ca..54c82588 100644 --- a/juniper/Cargo.toml +++ b/juniper/Cargo.toml @@ -6,7 +6,7 @@ workspace = ".." edition = "2018" [dependencies] -actix-web = "1.0.0-alpha.4" +actix-web = "1.0.0-beta.3" env_logger = "0.6" futures = "0.1" serde = "1.0" diff --git a/middleware/Cargo.toml b/middleware/Cargo.toml index e6d9cc3a..b17594fd 100644 --- a/middleware/Cargo.toml +++ b/middleware/Cargo.toml @@ -7,6 +7,6 @@ workspace = ".." [dependencies] actix-service = "0.3.6" -actix-web = "1.0.0-alpha.4" +actix-web = "1.0.0-beta.3" futures = "0.1.25" env_logger = "0.6" \ No newline at end of file diff --git a/multipart/Cargo.toml b/multipart/Cargo.toml index 256683d1..5fc3e2a8 100644 --- a/multipart/Cargo.toml +++ b/multipart/Cargo.toml @@ -10,7 +10,7 @@ name = "multipart" path = "src/main.rs" [dependencies] -actix-web = "1.0.0-beta.1" +actix-web = "1.0.0-beta.3" actix-multipart = "0.1.0-beta.1" env_logger = "0.6" diff --git a/multipart/src/main.rs b/multipart/src/main.rs index da7b929a..791b7941 100644 --- a/multipart/src/main.rs +++ b/multipart/src/main.rs @@ -23,11 +23,10 @@ pub fn save_file(field: Field) -> impl Future { // fs operations are blocking, we have to execute writes // on threadpool web::block(move || { - file.write_all(bytes.as_ref()) - .map_err(|e| { - println!("file.write_all failed: {:?}", e); - MultipartError::Payload(error::PayloadError::Io(e)) - })?; + file.write_all(bytes.as_ref()).map_err(|e| { + println!("file.write_all failed: {:?}", e); + MultipartError::Payload(error::PayloadError::Io(e)) + })?; acc += bytes.len() as i64; Ok((file, acc)) }) diff --git a/protobuf/Cargo.toml b/protobuf/Cargo.toml index a20640b0..c80df979 100644 --- a/protobuf/Cargo.toml +++ b/protobuf/Cargo.toml @@ -13,4 +13,4 @@ derive_more = "0.14" prost = "0.2.0" prost-derive = "0.2.0" -actix-web = "1.0.0-alpha.4" +actix-web = "1.0.0-beta.3" diff --git a/r2d2/Cargo.toml b/r2d2/Cargo.toml index 86e70e3f..f869e4e5 100644 --- a/r2d2/Cargo.toml +++ b/r2d2/Cargo.toml @@ -7,7 +7,7 @@ workspace = ".." [dependencies] actix-rt = "0.2" -actix-web = "1.0.0-alpha.4" +actix-web = "1.0.0-beta.3" futures = "0.1" env_logger = "0.6" diff --git a/redis-session/Cargo.toml b/redis-session/Cargo.toml index fc347f8f..19ac65aa 100644 --- a/redis-session/Cargo.toml +++ b/redis-session/Cargo.toml @@ -6,8 +6,8 @@ workspace = ".." edition = "2018" [dependencies] -actix = "0.8.0-alpha.2" -actix-web = "1.0.0-alpha.4" -actix-session = "0.1.0-alpha.4" +actix = "0.8.1" +actix-web = "1.0.0-beta.3" +actix-session = "0.1.0-beta.2" actix-redis = { git = "https://github.com/actix/actix-redis.git", features = ["web"] } env_logger = "0.6" diff --git a/simple-auth-server/Cargo.toml b/simple-auth-server/Cargo.toml index 54d2a5e4..ec815e94 100644 --- a/simple-auth-server/Cargo.toml +++ b/simple-auth-server/Cargo.toml @@ -8,7 +8,7 @@ workspace = ".." [dependencies] actix = { version = "0.8.1", features = ["http"] } actix-rt = "0.2.2" -actix-web = "1.0.0-beta.1" +actix-web = "1.0.0-beta.3" actix-files = "0.1.0-beta.1" bcrypt = "0.2.1" diff --git a/state/Cargo.toml b/state/Cargo.toml index 894d49d6..b0be5565 100644 --- a/state/Cargo.toml +++ b/state/Cargo.toml @@ -6,6 +6,6 @@ workspace = ".." edition = "2018" [dependencies] -actix-web = "1.0.0-alpha.4" +actix-web = "1.0.0-beta.3" futures = "0.1.25" env_logger = "0.6" diff --git a/static_index/Cargo.toml b/static_index/Cargo.toml index 196e112d..a5153402 100644 --- a/static_index/Cargo.toml +++ b/static_index/Cargo.toml @@ -9,5 +9,5 @@ edition = "2018" futures = "0.1" env_logger = "0.5" -actix-web = "1.0.0-alpha.4" -actix-files = "0.1.0-alpha.4" +actix-web = "1.0.0-beta.3" +actix-files = "0.1.0-beta.1" diff --git a/template_askama/Cargo.toml b/template_askama/Cargo.toml index 09fc9e81..8cecb147 100644 --- a/template_askama/Cargo.toml +++ b/template_askama/Cargo.toml @@ -6,7 +6,7 @@ workspace = ".." edition = "2018" [dependencies] -actix-web = "1.0.0-alpha.4" +actix-web = "1.0.0-beta.3" env_logger = "0.6" askama = "0.8" diff --git a/template_tera/Cargo.toml b/template_tera/Cargo.toml index 700f4f8a..5c00ba1d 100644 --- a/template_tera/Cargo.toml +++ b/template_tera/Cargo.toml @@ -8,4 +8,4 @@ edition = "2018" [dependencies] env_logger = "0.6" tera = "0.11" -actix-web = "1.0.0-alpha.4" +actix-web = "1.0.0-beta.3" diff --git a/template_yarte/Cargo.toml b/template_yarte/Cargo.toml index 24eba8ec..81d5e9cb 100644 --- a/template_yarte/Cargo.toml +++ b/template_yarte/Cargo.toml @@ -12,7 +12,7 @@ env_logger = "0.6" yarte = { version = "0.2", features=["with-actix-web"] } -actix-web = "1.0.0-alpha.4" +actix-web = "1.0.0-beta.3" [build-dependencies] yarte = { version = "0.2", features=["with-actix-web"] } diff --git a/web-cors/backend/Cargo.toml b/web-cors/backend/Cargo.toml index 19309063..39e779e4 100644 --- a/web-cors/backend/Cargo.toml +++ b/web-cors/backend/Cargo.toml @@ -6,7 +6,7 @@ workspace = "../../" edition = "2018" [dependencies] -actix-web = "1.0.0-alpha.4" +actix-web = "1.0.0-beta.3" serde = "1.0" serde_derive = "1.0" serde_json = "1.0" diff --git a/websocket-chat/Cargo.toml b/websocket-chat/Cargo.toml index e59f220a..fe62f8b7 100644 --- a/websocket-chat/Cargo.toml +++ b/websocket-chat/Cargo.toml @@ -10,10 +10,10 @@ name = "websocket-chat-server" path = "src/main.rs" [dependencies] -actix = "0.8.0-alpha.2" -actix-web = "1.0.0-alpha.4" -actix-web-actors = "1.0.0-alpha.2" -actix-files = "0.1.0-alpha.4" +actix = "0.8.1" +actix-web = "1.0.0-beta.3" +actix-web-actors = "1.0.0-alpha.3" +actix-files = "0.1.0-beta.1" rand = "0.6" bytes = "0.4" diff --git a/websocket-tcp-chat/Cargo.toml b/websocket-tcp-chat/Cargo.toml index b812bfa0..330357f6 100644 --- a/websocket-tcp-chat/Cargo.toml +++ b/websocket-tcp-chat/Cargo.toml @@ -14,10 +14,10 @@ name = "websocket-tcp-client" path = "src/client.rs" [dependencies] -actix = "0.8.0-alpha.2" -actix-web = "1.0.0-alpha.4" +actix = "0.8.1" +actix-web = "1.0.0-beta.3" actix-web-actors = "1.0.0-alpha.3" -actix-files = "0.1.0-alpha.4" +actix-files = "0.1.0-beta.1" rand = "0.6" bytes = "0.4" diff --git a/websocket/Cargo.toml b/websocket/Cargo.toml index 1c67978f..f4767c8e 100644 --- a/websocket/Cargo.toml +++ b/websocket/Cargo.toml @@ -14,10 +14,10 @@ path = "src/main.rs" #path = "src/client.rs" [dependencies] -actix = "0.8.0-alpha.2" -actix-web = "1.0.0-alpha.4" +actix = "0.8.1" +actix-web = "1.0.0-beta.3" actix-web-actors = "1.0.0-alpha.3" -actix-files = "0.1.0-alpha.4" +actix-files = "0.1.0-beta.1" env_logger = "0.6" futures = "0.1" bytes = "0.4" \ No newline at end of file