mirror of https://github.com/fafhrd91/actix-web
files: Test for symlink files
This commit is contained in:
parent
d519a28c50
commit
4ada4681c6
|
@ -754,4 +754,19 @@ mod tests {
|
||||||
let res = test::call_service(&srv, req).await;
|
let res = test::call_service(&srv, req).await;
|
||||||
assert_eq!(res.status(), StatusCode::OK);
|
assert_eq!(res.status(), StatusCode::OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[actix_rt::test]
|
||||||
|
async fn test_symlinks() {
|
||||||
|
let srv = test::init_service(App::new().service(Files::new("test", "."))).await;
|
||||||
|
|
||||||
|
let req = TestRequest::get()
|
||||||
|
.uri("/test/tests/symlink-test.png")
|
||||||
|
.to_request();
|
||||||
|
let res = test::call_service(&srv, req).await;
|
||||||
|
assert_eq!(res.status(), StatusCode::OK);
|
||||||
|
assert_eq!(
|
||||||
|
res.headers().get(header::CONTENT_DISPOSITION).unwrap(),
|
||||||
|
"inline; filename=\"symlink-test.png\""
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
test.png
|
Loading…
Reference in New Issue