Remove Option from RequestHeadType::Rc
- Langage dominant
- Rust
- Étoiles
- 24.8k
- Forks
- 1.9k
- Merge moyen
- 23 h 10 min
- PR mergées (30 j)
- 26
Description
When working with middlewares, I needed to destructure into the ConnectRequest and RequestHeadType to add new headers into the request. If `RequestHeadType::Rc` defaulted to having an empty headermap instead of an Option it would be possible to implement a `headers_mut()` method on ConnectRequest for easy header additions.
I realize that providing a `headers_mut()` for the `RequestHeadType::Rc` case might be misleading, since it won't be possible to remove existing headers, but maybe with a bit of documentation that could be fine
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Start by locating RequestHeadType::Rc and ConnectRequest in the actix-web source, then inspect the middleware-related tests or examples that exercise request headers. Evaluate the proposed empty HeaderMap and headers_mut API, including the limitation around removing existing headers. Done means the behavior and documentation clearly match the agreed API design.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- rust
- Domaine
- api, backend
- Type d'issue
- Fonctionnalité
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 25/100