diff --git a/actix-files/CHANGES.md b/actix-files/CHANGES.md index 2421890d1..5999f2764 100644 --- a/actix-files/CHANGES.md +++ b/actix-files/CHANGES.md @@ -1,6 +1,6 @@ # Changes -## [0.1.5] - unreleased +## [0.1.5] - 2019-10-08 * Bump up `mime_guess` crate version to 2.0.1 @@ -8,6 +8,7 @@ * Allow user defined request guards for `Files` #1113 + ## [0.1.4] - 2019-07-20 * Allow to disable `Content-Disposition` header #686 diff --git a/actix-files/Cargo.toml b/actix-files/Cargo.toml index 8f36cddc3..971db7929 100644 --- a/actix-files/Cargo.toml +++ b/actix-files/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "actix-files" -version = "0.1.4" +version = "0.1.5" authors = ["Nikolay Kim "] description = "Static files support for actix web." readme = "README.md" @@ -18,7 +18,7 @@ name = "actix_files" path = "src/lib.rs" [dependencies] -actix-web = { version = "1.0.2", default-features = false } +actix-web = { version = "1.0.8", default-features = false } actix-http = "0.2.9" actix-service = "0.4.1" bitflags = "1" @@ -32,4 +32,4 @@ percent-encoding = "2.1" v_htmlescape = "0.4" [dev-dependencies] -actix-web = { version = "1.0.2", features=["ssl"] } +actix-web = { version = "1.0.8", features=["ssl"] } diff --git a/actix-files/src/lib.rs b/actix-files/src/lib.rs index 7fc3c45c4..1cc26629d 100644 --- a/actix-files/src/lib.rs +++ b/actix-files/src/lib.rs @@ -15,8 +15,8 @@ use actix_web::dev::{ AppService, HttpServiceFactory, Payload, ResourceDef, ServiceRequest, ServiceResponse, }; -use actix_web::guard::Guard; use actix_web::error::{BlockingError, Error, ErrorInternalServerError}; +use actix_web::guard::Guard; use actix_web::http::header::{self, DispositionType}; use actix_web::http::Method; use actix_web::{web, FromRequest, HttpRequest, HttpResponse, Responder}; @@ -485,7 +485,7 @@ impl Service for FilesService { return Either::A(ok(req.into_response( actix_web::HttpResponse::MethodNotAllowed() .header(header::CONTENT_TYPE, "text/plain") - .body("Request did not meet this resource's requirements.") + .body("Request did not meet this resource's requirements."), ))); } @@ -1047,9 +1047,7 @@ mod tests { #[test] fn test_files_not_allowed() { - let mut srv = test::init_service( - App::new().service(Files::new("/", ".")), - ); + let mut srv = test::init_service(App::new().service(Files::new("/", "."))); let req = TestRequest::default() .uri("/Cargo.toml") @@ -1059,10 +1057,11 @@ mod tests { let resp = test::call_service(&mut srv, req); assert_eq!(resp.status(), StatusCode::METHOD_NOT_ALLOWED); - let mut srv = test::init_service( - App::new().service(Files::new("/", ".")), - ); - let req = TestRequest::default().method(Method::PUT).uri("/Cargo.toml").to_request(); + let mut srv = test::init_service(App::new().service(Files::new("/", "."))); + let req = TestRequest::default() + .method(Method::PUT) + .uri("/Cargo.toml") + .to_request(); let resp = test::call_service(&mut srv, req); assert_eq!(resp.status(), StatusCode::METHOD_NOT_ALLOWED); } @@ -1070,10 +1069,7 @@ mod tests { #[test] fn test_files_guards() { let mut srv = test::init_service( - App::new().service( - Files::new("/", ".") - .use_guards(guard::Post()) - ), + App::new().service(Files::new("/", ".").use_guards(guard::Post())), ); let req = TestRequest::default()