diff options
author | Ali MJ Al-Nasrawy <alimjalnasrawy@gmail.com> | 2022-02-05 20:30:47 +0000 |
---|---|---|
committer | Ali MJ Al-Nasrawy <alimjalnasrawy@gmail.com> | 2022-02-05 20:39:25 +0000 |
commit | dd665a4c7e97a8a7513f38ad9293cd8edbe136df (patch) | |
tree | 6eb0e3cee4b1355f68e68e9912b7c15b328f4297 /src/main.rs | |
parent | merge from jikstra (diff) | |
download | miniserve-dd665a4c7e97a8a7513f38ad9293cd8edbe136df.tar.gz miniserve-dd665a4c7e97a8a7513f38ad9293cd8edbe136df.zip |
update to actix-web v4.0-rc.2
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs index 5b239e4..7f1944f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,8 +6,6 @@ use std::thread; use std::time::Duration; use actix_files::NamedFile; -use actix_web::body::BoxBody; -use actix_web::middleware::Compat; use actix_web::web; use actix_web::{http::header::ContentType, Responder}; use actix_web::{middleware, App, HttpRequest, HttpResponse}; @@ -200,7 +198,9 @@ async fn run(miniserve_config: MiniserveConfig) -> Result<(), ContextualError> { web::scope(inside_config.random_route.as_deref().unwrap_or("")) .wrap(middleware::Condition::new( !inside_config.auth.is_empty(), - Compat::new(HttpAuthentication::basic(auth::handle_auth)), + actix_web::middleware::Compat::new(HttpAuthentication::basic( + auth::handle_auth, + )), )) .configure(|c| configure_app(c, &inside_config)), ) @@ -366,7 +366,7 @@ async fn css() -> impl Responder { let css = include_str!(concat!(env!("OUT_DIR"), "/style.css")); HttpResponse::Ok() .insert_header(ContentType(mime::TEXT_CSS)) - .message_body(BoxBody::new(css)) + .body(css) } // Prints to the console two inverted QrCodes side by side. |