actix / actix/actix-web

Remove Option from RequestHeadType::Rc

Aperta
#2,477 2 commenti 0 reazioni 1 assegnatario Rivendicata da @robjtede Vedi su GitHub
A-awc A-http C-improvement
Lingua principale
Rust
Stelle
24.8k
Fork
1.9k
Merge medio
23h 10m
PR unite (30g)
26

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.