nodejs / nodejs/node

Missing `Http2ServerResponse.setHeaders()`

オープン
#51,573 コメント 6 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

feature request http2
主要言語
JavaScript
スター
122k
フォーク
37.3k
平均マージ
4日 2時間
マージ済み PR(30日)
283

説明

What is the problem this feature will solve?

Make it possible to use response.setHeaders() on both old HTTP response objects and ones coming from node:http2.

BTW I wasn't sure if this should be a "feature request" or a "bug."

What is the feature you are proposing to solve the problem?

Add the method http2.Http2ServerResponse.setHeaders() to have the same API as http.OutgoingMessage.setHeaders().

See https://nodejs.org/api/http.html#outgoingmessagesetheadersheaders.

What alternatives have you considered?
  • Avoiding using setHeaders() at all.
  • Monkey-patching Http2ServerResponse.
  • Just writing two versions of my own set-headers code, on the assumption that, when available, setHeaders() is the most efficient option.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

調査の方向性

node:http2 Http2ServerResponse のエントリーポイントから始め、リンク先の HTTP ドキュメントを動作のリファレンスとして使用して、その API を http.OutgoingMessage.setHeaders() と比較します。完了の条件は、Http2ServerResponse が既存の HTTP レスポンスオブジェクトと同じ API と動作で setHeaders() を公開し、新しいメソッドに対する適切なカバレッジがあることです。

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

評価

技術スタック
javascript, node.js
領域
api, backend
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
52/100

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

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