Commit Graph

26 Commits

Author SHA1 Message Date
Akshay Shah 58ea2e00fc
web: make HTTP field names case-insensitive (#32364)
I'm opening this PR to (hopefully!) stimulate a discussion. In brief,
I'd like to amend the gRPC-Web protocol docs to encourage
implementations to follow HTTP semantics and compare HTTP field names
case-insensitively.

The gRPC-Web specification is a nicely-designed way for proxies to
expose standard HTTP/2 gRPC servers to clients using less
tightly-controlled HTTP stacks, such as web browsers. To serve that
goal, it seems valuable to have the gRPC-Web specification follow [RFC
9110 (HTTP
Semantics)](https://www.rfc-editor.org/rfc/rfc9110.html#name-field-names).
Like previous RFCs, 9110 specifies that "field names are
case-insensitive." However, the current gRPC-Web specification requires
that servers and proxies "use lower-case header/trailer names" on the
wire. In principle, mandating casing on the wire is normal for HTTP/2
and fine (if unusual) for HTTP/1.1; however, it encourages
implementations to violate HTTP semantics and require lower-case names
when _reading_ headers and trailers.

I'd like to loosen the gRPC-Web specification to permit any casing on
the wire for HTTP/1.1. I'd also like to emphasize that gRPC-Web
implementations ought to follow standard HTTP semantics when _reading_
fields and compare names case-insensitively. Implementations that can't
treat names case-insensitively without breaking backward compatibility
should instead normalize field names to lowercase. Among the
Google-maintained gRPC implementations, at least `grpc-go` and
`grpc-java` already compare names case-insensitively (even though
they're HTTP/2-only). `grpc-dart` does the opposite and compares names
case-sensitively. `grpc-web` is sometimes case-insensitive (when reading
`grpc-status` and `grpc-message` from trailers-only responses) and
sometimes case-sensitive (when hand-parsing a block of length-prefixed
trailers).

The proposed amendment does not affect the correctness of Envoy (which
may continue to use lower-case field names). It partially affects
`grpc-web`, which would require a small patch to always normalize names.
(Both patched and unpatched versions of `grpc-web` would work with
Envoy.) `grpc-dart` would need to either begin treating field names
case-insensitively or normalize names, depending on what's possible in
Dart without breaking backward compatibility.

Relates to https://github.com/improbable-eng/grpc-web/issues/228,
https://github.com/bufbuild/connect-go/issues/453/, and
https://github.com/grpc/grpc-dart/issues/594.
2023-03-17 15:37:40 -07:00
maoyangLiu 45bceae7a5
fix the outdate url (#25849)
Signed-off-by: maoyangLiu <liumaoyang@inspur.com>
2021-04-28 18:24:56 -07:00
Igor Slepchin 89cc262dc8
fix typo 2020-03-08 01:27:04 -05:00
Vu Cong Tuan 69fab8eacb Fix many typos in doc
Signed-off-by: Vu Cong Tuan <tuanvc@vn.fujitsu.com>
2019-02-14 11:14:16 +07:00
Wenbo Zhu e769c8c505
Update PROTOCOL-WEB.md 2018-06-13 16:14:37 -07:00
Eric Anderson 5e4a5c8dff
Merge pull request #13520 from abdulhannanali/patch-1
Correct the link to the Streams Spec Repo
2018-03-29 09:50:54 -07:00
Wenbo Zhu a01137507d
Update PROTOCOL-WEB.md 2018-03-27 15:31:12 -07:00
Wenbo Zhu ab8580d940
Remove browser-specific features. 2018-03-27 14:20:08 -07:00
otofune cc57ab5e08 fix PROTOCOL-HTTP2 to PROTOCOL-HTTP2.md
forget .md
2017-12-29 20:16:40 +00:00
otofune 1dfd8746d7 Use 'PROTOCOL-HTTP2.md' as 'gRPC over HTTP2' link 2017-12-29 18:30:48 +00:00
Hannan Ali f5809cced8
Correct the link to the Streams Spec Repo
Streams Specification is being worked on in it's own repository under WHATWG
2017-11-28 06:16:44 -07:00
Mehrdad Afshari bb3d95b643 Use https://grpc.io consistently as the canonical URL 2017-07-10 22:24:28 +00:00
Feng Li 1e9a93c3f5 Remove the section for b64 encoded trailers.
Remove the section for b64 encoded trailers. As gRPC-Web uses CRLF to separate the trailers in the trailers frame, a binary trailer need to reserve in a base64 encoded format for their values. This cannot be skipped even base64 is applied on the whole trailers frame per client's request via content-type: application/grpc-web-text.
2017-05-24 15:55:33 -07:00
Wenbo Zhu 69ac56f7c0 Update PROTOCOL-WEB.md 2017-05-19 12:15:26 -07:00
Wenbo Zhu f9ca154066 Update PROTOCOL-WEB.md 2017-05-19 10:33:06 -07:00
Wenbo Zhu 0408aa85d9 Update PROTOCOL-WEB.md
Clarify the content type requirement (for message formats).
2017-05-18 19:02:42 -07:00
Alexander Polcyn d809a15ec4 cpp doc nits 2017-05-05 11:02:07 -07:00
Wenbo Zhu 609eca0e36 Update PROTOCOL-WEB.md
Clarify the use of U-A header.
2017-03-30 16:18:14 -07:00
Wenbo Zhu 880b7981d8 Update PROTOCOL-WEB.md
Remove text-base64 C-T. Will revisit if we ever need support non-default (base64) encoding.
2017-03-02 17:41:36 -08:00
Wenbo Zhu a56edc43f4 Update PROTOCOL-WEB.md 2017-02-27 16:21:45 -08:00
Wenbo Zhu ea16fa1598 Update PROTOCOL-WEB.md 2017-02-27 16:20:43 -08:00
Wenbo Zhu 0258444a81 Update PROTOCOL-WEB.md
Addressed @mwitkow comments.

https://github.com/grpc/grpc-web/issues/57
2017-02-27 14:21:42 -08:00
Wenbo Zhu 7b6ad2d508 Update PROTOCOL-WEB.md
Mention the Server header format
2017-02-06 14:26:32 -08:00
Wenbo Zhu e5cf8f0ee0 Update PROTOCOL-WEB.md
1. Clarify about trailer-only responses
2. Switch to http/1.1 header block format for in-body trailer encoding
3. Clarify how compatibility is supported (using U-A and Server headers respectively)
2017-02-06 14:23:03 -08:00
Wenbo Zhu fd825f51ac Update PROTOCOL-WEB.md
Using http/2 literal header format for status.
2016-11-10 15:47:03 -08:00
Wenbo Zhu 4daba4b6ba Create PROTOCOL-WEB.md 2016-11-07 18:23:53 -08:00