grpc / grpc/grpc-java

Support for HTTP/2 non-indexed header fields

オープン
#5,249 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement
主要言語
Java
スター
12.1k
フォーク
4k
平均マージ
2日 17時間
マージ済み PR(30日)
37

説明

### What version of gRPC are you using?
08efd978d7d2749cc267b0b6e61547af3d5c9515 (HEAD on Jan 3, 2019)

### What did you expect to see?
Ability to set header names outside of a-z, -

We are trying to send a signature value as gRPC metadata, the value changes with every message.
Metadata is translated to headers in HTTP/2 which in our case, due to HPACK, the client, server and reverse proxy store in [the dynamic](https://tools.ietf.org/html/draft-ietf-httpbis-header-compression-12#section-2.3.2) table for header compression.
As a result the dynamic table size will increase until its full ([by default up to 4096 octets](https://tools.ietf.org/html/rfc7540#section-6.5.2)).
When it's entries are removed from the dynamic table in FIFO order to make space for the new entries.
This is undesirable because of the increase in memory use in our proxy and because after X requests all the headers are resent.

HTTP/2 supports non-indexed headers, which as far as I can gather from the docs, [do not get stored in the dynamic table](https://tools.ietf.org/html/draft-ietf-httpbis-header-compression-12#section-6.2.2).
You signal a non-indexed header with the first four bytes of the header key being '0001' or '0000'.
However these are non-valid ASCII characters and thus do not get through the [validity check](https://github.com/grpc/grpc-java/blob/5dbe53c050d8e5f82b65df1e0c110e5c4fdaa5e7/core/src/main/java/io/grpc/Metadata.java#L620).
I'm sure the validity check is there for a reason, and I very much realize we're in an edge case here.

Would it be possible at all to bypass the check or is this something that shouldn't be done for compatibility reasons?

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

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

調査の方向性

core/src/main/java/io/grpc/Metadata.java の 620 行付近にある妥当性チェックから始め、次にリンクされている HTTP/2 と HPACK のセクションを読んで、要求されているインデックスされないヘッダーの動作を理解してください。これらのメタデータ名のサポートが既存の検証と互換性があるかどうかを判断し、完了とみなせる互換性を損なわない動作を定義してください。

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

評価

技術スタック
grpc, java
領域
api, networking
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

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

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