Appendix A. 静态表定义 (Static Table Definition)
static table (见 Section 2.3.1) 由预定义且不可更改的 header field 列表组成.
static table 是通过确定热门网站最常用的 header field, 并加入 HTTP/2 特有的 pseudo-header field (见 [HTTP2] 的 Section 8.1.2.1) 而创建的.
对于出现在 static table 中的 header field, 名称始终作为对 static table 条目的引用发送, 值则作为对 static table 条目的引用发送, 或编码为 literal.
下表按顺序列出 static table 的条目. "Index" 列给出条目的索引. "Header Name" 列给出 header field 的名称. "Header Value" 列给出为该 header field 存储的值.
编码器可以通过 indexed header field representation 直接引用这些条目, 或者在 literal header field representation 中只引用其中的 header name. 解码器 MUST 使用完全相同的索引和值解释该表, 因为 static table 不随连接状态变化, 也不受 dynamic table size update 影响. 空的 Header Value 表示该条目只预定义了 header name, 具体值需要在编码的 header block 中另行提供.
该表中的 pseudo-header fields (例如 :method, :path, :scheme 和 :status) 来自 HTTP/2 语义. 其他条目是常见 HTTP header fields. 表项顺序是协议的一部分, 因而索引号, header name 和预定义 header value 都必须保持不变.
| Index (索引) | Header Name (头字段名称) | Header Value (头字段值) |
|---|---|---|
| 1 | :authority | |
| 2 | :method | GET |
| 3 | :method | POST |
| 4 | :path | / |
| 5 | :path | /index.html |
| 6 | :scheme | http |
| 7 | :scheme | https |
| 8 | :status | 200 |
| 9 | :status | 204 |
| 10 | :status | 206 |
| 11 | :status | 304 |
| 12 | :status | 400 |
| 13 | :status | 404 |
| 14 | :status | 500 |
| 15 | accept-charset | |
| 16 | accept-encoding | gzip, deflate |
| 17 | accept-language | |
| 18 | accept-ranges | |
| 19 | accept | |
| 20 | access-control-allow-origin | |
| 21 | age | |
| 22 | allow | |
| 23 | authorization | |
| 24 | cache-control | |
| 25 | content-disposition | |
| 26 | content-encoding | |
| 27 | content-language | |
| 28 | content-length | |
| 29 | content-location | |
| 30 | content-range | |
| 31 | content-type | |
| 32 | cookie | |
| 33 | date | |
| 34 | etag | |
| 35 | expect | |
| 36 | expires | |
| 37 | from | |
| 38 | host | |
| 39 | if-match | |
| 40 | if-modified-since | |
| 41 | if-none-match | |
| 42 | if-range | |
| 43 | if-unmodified-since | |
| 44 | last-modified | |
| 45 | link | |
| 46 | location | |
| 47 | max-forwards | |
| 48 | proxy-authenticate | |
| 49 | proxy-authorization | |
| 50 | range | |
| 51 | referer | |
| 52 | refresh | |
| 53 | retry-after | |
| 54 | server | |
| 55 | set-cookie | |
| 56 | strict-transport-security | |
| 57 | transfer-encoding | |
| 58 | user-agent | |
| 59 | vary | |
| 60 | via | |
| 61 | www-authenticate |