Header fields should be case insensitive (RFC 7230 §3.2, RFC 9110 §5.1)
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- rust
- 領域
- api, networking
調査の方向性
まず、HeaderName::from_static と併せて HeaderMap::get および HeaderMap::insert の動作を調べ、issue にある大文字と小文字を区別する例を再現ケースとして使用します。完了条件は、ヘッダー名の取得で大文字と小文字の違いが受け入れられること、from_static が有効なフィールド名に対してパニックしなくなること、元の大文字と小文字が保持されることです。
索引モデルが issue の本文から書いたものです。
説明
I'm working with http::HeaderMap and noticed that HeaderMap::get, HeaderMap::insert, and HeaderName::from_static all seem to be case sensitive (in fact, the latter panics:
HeaderName::from_static("Content-Type")
panics with:
index out of bounds: the len is 0 but the index is 0
while:
HeaderName::from_static("content-type")
does not.
This goes against the HTTP spec requiring case-insensitive handling of header values:
- RFC 7230 §3.2
Each header field consists of a case-insensitive field name followed by a colon (":"), optional leading whitespace, the field value, and optional trailing whitespace.
- RFC 9110 §5.1
Field names are case-insensitive...
IMO, this is distinct from #670, and in fact case-insensitive keys should solve that issue as well, while not requiring the original cases to be changed.
It looks like crates like case_insensitive_hashmap and unicase are examples of case-insensitive String handling.
Is there any way to just make the HeaderMap case-insensitive for retrieval? That would preserve original case as well as allow any case for HeaderMap::get to meet the spec and prevent errors.
- 主要言語
- Rust
- スター
- 1.4k
- フォーク
- 380
- 平均マージ
- 2日 5時間
- マージ済み PR(30日)
- 4
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
hyperium/http のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 62/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 62/100
似ている issue
-
`categorize_command` has no `uv` arm, so every `rtk uv …` row counts as `other` in the ecosystem mixオープンarea:api bug good first issue priority:low
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 92/100
メンテナーはふだん 1 日以内に返信
-
area/cli kind/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
good first issue open-endedness: low type: new feature
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100