HTTP/2 `:authority` header 应该包含端口号吗?

Should the HTTP/2 `:authority` header include port number?

从 开始,同样的逻辑是否适用于 HTTP/2?

即如果浏览器向 https://server.com:1234/ 发出请求,:authority header 应该是 server.com 还是 server.com:1234

它应该,:authority 被 RFC 7540 (https://www.rfc-editor.org/rfc/rfc7540#section-8.1.2.3) 定义为:

pseudo-header field includes the authority portion of the target URI ([RFC3986], Section 3.2). The authority MUST NOT include the deprecated "userinfo" subcomponent for "http" or "https" schemed URIs.

RFC 3986 将权限描述为:

  authority   = [ userinfo "@" ] host [ ":" port ]

所以是的,它应该包括端口,如果端口不是方案的默认端口。