Invalid cookies can be created without error
- 主要語言
- Rust
- 星號
- 24.8k
- 分支
- 1.9k
- 平均合併
- 23 小時 10 分鐘
- 30 天內合併 PR
- 26
描述
[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.
貢獻指南
研究方向
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.
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- rust
- 領域
- api, backend
- Issue 類型
- 功能
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 38/100