hyperium / headers

Typed HTTP Headers from hyper
https://hyper.rs
MIT License
164 stars 84 forks source link

Add From<Origin> implementation for AccessControlAllowOrigin #111

Open acerempel opened 2 years ago

acerempel commented 2 years ago

Currently the TryFrom<&str> implementation is the only way – as far as I can tell – to create an AccessControlAllowOrigin header for a specific origin. If you already have an Origin, it feels a bit silly to use TryFrom, since the conversion should be simple and infallible. This change adds that conversion.