mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-27 17:22:57 +01:00
prepare actix-files release
This commit is contained in:
parent
4de2e8a898
commit
a464ffc23d
@ -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
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "actix-files"
|
||||
version = "0.1.4"
|
||||
version = "0.1.5"
|
||||
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
||||
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"] }
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user