-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
C-featureCategory: feature. This is adding a new feature.Category: feature. This is adding a new feature.
Description
I've run into the case several times when unit testing where I need to return a Response whose extensions contain an HttpInfo. However, since the fields on HttpInfo are private, I am unable to create one.
I would like to see a way to create a new HttpInfo, either by making the fields public, adding setters, or by adding a constructor. Since there are already getter methods, I think it may make most sense to:
- Add a constructor to create a new
HttpInfo. - Add setters for the remote and local addresses.
Note that it is already possible to get a mutable reference to HttpInfo via:
let mut response = Response::new(Body::empty());
let http_info = response.extensions_mut().get_mut::<HttpInfo>().unwrap();but without setters, there is nothing you can do with it.
Metadata
Metadata
Assignees
Labels
C-featureCategory: feature. This is adding a new feature.Category: feature. This is adding a new feature.