diff --git a/BUILD b/BUILD index 2b8c1180d2a..1ec3a7595da 100644 --- a/BUILD +++ b/BUILD @@ -36,6 +36,8 @@ licenses(["notice"]) # 3-clause BSD +exports_files(["LICENSE"]) + package(default_visibility = ["//visibility:public"]) diff --git a/doc/PROTOCOL-HTTP2.md b/doc/PROTOCOL-HTTP2.md index 31d694b803d..df7585d6099 100644 --- a/doc/PROTOCOL-HTTP2.md +++ b/doc/PROTOCOL-HTTP2.md @@ -98,8 +98,11 @@ For requests, **EOS** (end-of-stream) is indicated by the presence of the END_ST * **Trailers-Only** → HTTP-Status Content-Type Trailers * **Trailers** → Status [Status-Message] \*Custom-Metadata * **HTTP-Status** → ":status 200" -* **Status** → "grpc-status" -* **Status-Message** → "grpc-message" +* **Status** → "grpc-status" 1\*DIGIT ; 0-9 +* **Status-Message** → "grpc-message" Percent-Encoded +* **Percent-Encoded** → 1\*(Percent-Byte-Unencoded / Percent-Byte-Encoded) +* **Percent-Byte-Unencoded** → 1\*( %x20-%x24 / %x26-%x7E ) ; space and VCHAR, except % +* **Percent-Byte-Encoded** → "%" 2HEXDIGIT ; 0-9 A-F **Response-Headers** & **Trailers-Only** are each delivered in a single HTTP2 HEADERS frame block. Most responses are expected to have both headers and trailers but **Trailers-Only** is permitted for calls that produce an immediate error. Status must be sent in **Trailers** even if the status code is OK. @@ -110,6 +113,21 @@ Implementations should expect broken deployments to send non-200 HTTP status cod Clients may limit the size of **Response-Headers**, **Trailers**, and **Trailers-Only**, with a default of 8 KiB each suggested. +The value portion of **Status** is a decimal-encoded integer as an ASCII string, +without any leading zeros. + +The value portion of **Status-Message** is conceptually a Unicode string +description of the error, physically encoded as UTF-8 followed by +percent-encoding. Percent-encoding is specified in [RFC 3986 +§2.1](https://tools.ietf.org/html/rfc3986#section-2.1), although the form used +here has different restricted characters. When decoding invalid values, +implementations MUST NOT error or throw away the message. At worst, the +implementation can abort decoding the status message altogether such that the +user would received the raw percent-encoded form. Alternatively, the +implementation can decode valid portions while leaving broken %-encodings as-is +or replacing them with a replacement character (e.g., '?' or the Unicode +replacement character). + ####Example Sample unary-call showing HTTP2 framing sequence diff --git a/examples/php/composer.json b/examples/php/composer.json index 97e9608fe01..e6409f87b43 100644 --- a/examples/php/composer.json +++ b/examples/php/composer.json @@ -2,6 +2,6 @@ "name": "grpc/grpc-demo", "description": "gRPC example for PHP", "require": { - "grpc/grpc": "v1.0.0", + "grpc/grpc": "v1.0.0" } } diff --git a/templates/BUILD.template b/templates/BUILD.template index 23a656c3608..af23fb27994 100644 --- a/templates/BUILD.template +++ b/templates/BUILD.template @@ -38,6 +38,8 @@ licenses(["notice"]) # 3-clause BSD + exports_files(["LICENSE"]) + package(default_visibility = ["//visibility:public"]) <%!