gpt4 book ai didi

http2 - HTTP/2 `:authority` header 是否应该包含端口号?

转载 作者:行者123 更新时间:2023-12-03 20:17:05 27 4
gpt4 key购买 nike

Is Port Number Required in HTTP "Host" Header Parameter? ,同样的逻辑是否适用于 HTTP/2?

即如果浏览器向 https://server.com:1234/ 发出请求,应该:authority标题是 server.comserver.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 ]

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

关于http2 - HTTP/2 `:authority` header 是否应该包含端口号?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50034792/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com