Following on from Is Port Number Required in HTTP "Host" Header Parameter?, does the same logic apply to HTTP/2?
i.e. if a browser makes a request to https://server.com:1234/, should the :authority
header be server.com
or server.com:1234
?
Following on from Is Port Number Required in HTTP "Host" Header Parameter?, does the same logic apply to HTTP/2?
i.e. if a browser makes a request to https://server.com:1234/, should the :authority
header be server.com
or server.com:1234
?
It should, :authority
is defined by RFC 7540 (https://www.rfc-editor.org/rfc/rfc7540#section-8.1.2.3) as a :
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 in turn describes authority as:
authority = [ userinfo "@" ] host [ ":" port ]
It then clarifies in 3.2.3. Port":
A scheme may define a default port. For example, the "http" scheme defines a default port of "80", corresponding to its reserved TCP port number. [...] URI producers and normalizers should omit the port component and its ":" delimiter if port is empty or if its value would be the same as that of the scheme's default.
So yes, it should include the port, if the port isn't the default for the scheme.
© 2022 - 2024 — McMap. All rights reserved.