1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-26 15:07:42 +02:00

return option item from Extensions::insert (#1904)

This commit is contained in:
Rob Ede
2021-01-15 04:22:42 +00:00
committed by GitHub
parent b1dd8d28bc
commit f976150b67
4 changed files with 82 additions and 17 deletions

View File

@ -662,7 +662,9 @@ async fn test_h1_service_error() {
async fn test_h1_on_connect() {
let srv = test_server(|| {
HttpService::build()
.on_connect_ext(|_, data| data.insert(20isize))
.on_connect_ext(|_, data| {
data.insert(20isize);
})
.h1(|req: Request| {
assert!(req.extensions().contains::<isize>());
future::ok::<_, ()>(Response::Ok().finish())