grpc / grpc/grpc-java

Support for HTTP/2 non-indexed header fields

Đang mở
#5,249 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
enhancement
Ngôn ngữ chính
Java
Star
12.1k
Fork
4k
Merge trung bình
2 ngày 17 giờ
Pull request đã merge (30 ngày)
37

Mô tả

### 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?

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu với bước kiểm tra tính hợp lệ trong core/src/main/java/io/grpc/Metadata.java, quanh dòng 620, sau đó đọc các phần HTTP/2 và HPACK được liên kết để hiểu hành vi được yêu cầu đối với các header không được lập chỉ mục. Xác định xem việc hỗ trợ các tên metadata này có tương thích với việc xác thực hiện có hay không, và xác định hành vi an toàn về khả năng tương thích để được xem là hoàn tất.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
grpc, java
Lĩnh vực
api, networking
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.