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

add connection level data container (#2491)

This commit is contained in:
Rob Ede
2021-12-07 17:23:34 +00:00
committed by GitHub
parent 069cf2da07
commit d35b7644dc
18 changed files with 152 additions and 125 deletions

View File

@ -7,7 +7,7 @@ use std::{
use actix_http::{
body::{self, BodyStream, BoxBody, SizedStream},
header, Error, HttpMessage, HttpService, KeepAlive, Request, Response, StatusCode,
header, Error, HttpService, KeepAlive, Request, Response, StatusCode,
};
use actix_http_test::test_server;
use actix_rt::time::sleep;
@ -748,7 +748,7 @@ async fn test_h1_on_connect() {
data.insert(20isize);
})
.h1(|req: Request| {
assert!(req.extensions().contains::<isize>());
assert!(req.conn_data::<isize>().is_some());
ok::<_, Infallible>(Response::ok())
})
.tcp()