Invalid cookies can be created without error
- Lingua principale
- Rust
- Stelle
- 24.8k
- Fork
- 1.9k
- Merge medio
- 23h 10m
- PR unite (30g)
- 26
Descrizione
[Cookie::set_value](https://docs.rs/actix-web/latest/actix_web/cookie/struct.Cookie.html#method.set_value) accepts any unicode string and never fails, but some unicode strings [are not valid cookie values](https://datatracker.ietf.org/doc/html/rfc6265#section-4.1.1).
Could we add a `try_set_value` method that only accepts valid values ?
Otherwise, we end up with confusing error messages, generated far from where the true source of the error is.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Start with Cookie::set_value in the linked API documentation and compare accepted values with RFC 6265 §4.1.1. Done means a try_set_value entry point rejects invalid cookie values and exposes the failure at the call site, with coverage for accepted and rejected values.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- rust
- Ambito
- api, backend
- Tipo di issue
- Funzionalità
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 38/100