Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

HeaderValue::to_str returns an error for valid unicode strings

オープン
#527 コメント 0 件 リアクション 5 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
rust
領域
api, networking

調査の方向性

まず HeaderValue::to_str と ToStrError の定義を見つけ、次にヘッダー値の文字列変換に関する既存のテストを確認します。変換の動作を変更する前に、HeaderValue の作成時にバイト列がどのように検証されるかを確認します。Unicode やタブを含む有効な UTF-8 が返され、無効な UTF-8 では引き続きエラーになり、ToStrError の名前の互換性が維持されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

HeaderValue::to_str() returns an error if the header value contains any byte that's not "visible ASCII" (though this is misleading as \t is legal even though it's not visible). This is weird, it should just return a string if it contains a valid string regardless of the contents. We already know it doesn't contain illegal bytes (as that's checked upon creation of HeaderValue) so we don't need to check again, and there's no reason to disallow unicode characters when getting the string representation.

I think the right thing here is to just replace the implementation with std::str::from_utf8(), and replace ToStrError with a pub use std::str::Utf8Error as ToStrError for backwards compatibility.

Also see #519.

主要言語
Rust
スター
1.4k
フォーク
382
平均マージ
10時間 32分
マージ済み PR(30日)
2

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

hyperium/http のほかの issue

hyperium/http の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。