Update encoding.rs

This commit is contained in:
Rob Ede 2021-03-09 19:55:52 +00:00 committed by GitHub
parent 497bcbaf8b
commit 4e7d96c8b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -35,7 +35,10 @@ async fn test_utf8_file_contents() {
res.headers().get(header::CONTENT_TYPE), res.headers().get(header::CONTENT_TYPE),
Some(&HeaderValue::from_static("text/plain; charset=utf-8")), Some(&HeaderValue::from_static("text/plain; charset=utf-8")),
); );
}
#[actix_rt::test]
async fn test_directory_traversal_prevention() {
// prevent directory traversal attack // prevent directory traversal attack
let srv = test::init_service(App::new().service(Files::new("/", "./tests"))).await; let srv = test::init_service(App::new().service(Files::new("/", "./tests"))).await;