HTTP/2 headers should not be included in snippets
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- typescript
- 領域
- tooling
調査の方向性
まず、HAR データがリクエストヘッダーに読み込まれる仕組みと、それらのヘッダーがスニペットジェネレーターに渡される仕組みを追跡します。HTTP/2 の HAR の例の入力を再現して、生成された curl の出力と比較し、その後、:authority や :method などの疑似ヘッダーが通常のヘッダーを削除せずに除外されることを確認します。
索引モデルが issue の本文から書いたものです。
説明
It doesn't seem to be explicitly specified anywhere, but when exporting a HAR file for HTTP/2 traffic, it seems that most clients (e.g. Chrome) do include the HTTP/2 pseudo-headers in the header data. These are headers like :authority and :method.
This makes sense for HAR files, when you want an accurate recording of the full traffic details, but these shouldn't be included in HTTP snippets imo. Most clients will reject them completely, for example this curl command generated by httpsnippet will always fail, even though the original request worked fine:
curl --request GET \
--url https://google.com/ \
--header ':authority: google.com' \
--header ':method: GET' \
--header ':path: /' \
--header ':scheme: https' \
--header 'accept: */*' \
--header 'user-agent: curl/7.68.0'
These headers are basically duplicating the method & URL parts, which we include separately anyway. They're just a detail of how the method & URL are sent in HTTP/2. They also won't work because I think in every snippet here we're sending pure HTTP/1 requests, where these are generally illegal header names anyway (which I guess is why curl fails here).
I would suggest we filter these out, i.e. drop all headers starting with : when we load data from the HAR. That will never happen in HTTP/1 traffic, and in HTTP/2 traffic it's almost always redundant, and the rare cases where it's not are very weird (I think sending a request to one domain but with a :authority header for different domain is the only possible example?).
Alternatively, we could try to fully translate HTTP/2 data back into the exactly equivalent HTTP/1 requests. I wrote a blog post about that a while back here: https://httptoolkit.tech/blog/translating-http-2-into-http-1/#translating-one-to-the-other. That would just be the first HTTP/2 -> HTTP/1 list, under 'Translating one to the other', and only half are relevant, so I think it's relatively simple, but it's still more complicated than just dropping the headers, and it might plausibly have other side effects.
What do you think?
- 主要言語
- TypeScript
- スター
- 1.2k
- フォーク
- 245
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Kong/httpsnippet のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
Kong/httpsnippet#356 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
Kong/httpsnippet#397 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
Kong/httpsnippet#389 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
Kong/httpsnippet#383 ·
-
Bug: R Code Generation Does Not Quote Parameters with Special Characters (e.g., `codes[]`)対応中かも @abansal21 が 499 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
Kong/httpsnippet#379 ·
Kong/httpsnippet の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
rel: fix
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Deltares/fews-web-oc#2400 ·
メンテナーはふだん 1 日以内に返信
-
Command bar: Tab-to-search on claude.ai falls back to Google site: search instead of opening a prompt on Claude対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
ardia-browser/ardia#4426 ·
メンテナーはふだん 1 日以内に返信
-
Bug report: isValidISODateDashOnly accepts text before or after the date-time対応中かも @bardrop が今日担当しました。 オープン
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
pnp/cli-microsoft365#7713 ·
メンテナーはふだん 1 日以内に返信
-
Diagram: Journey Type: Bug / Error
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
mermaid-js/mermaid-v13#1293 ·
メンテナーはふだん 1 日以内に返信