]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: http: Considere empty ports as valid default ports
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 21 Nov 2022 17:57:49 +0000 (18:57 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 22 Nov 2022 15:56:49 +0000 (16:56 +0100)
commit99ade9e0dac03be464ea488e2424351ee0bc2aae
treec3e829e04438506c26e8873c11862d1afbf14e6b
parent75348c2e8b7779d1b00d849ecb5b8324033210f7
MINOR: http: Considere empty ports as valid default ports

In RFC3986#6.2.3, following URIs are considered as equivalent:

      http://example.com
      http://example.com/
      http://example.com:/
      http://example.com:80/

The third one is interristing because the port is empty and it is still
considered as a default port. Thus, http_get_host_port() does no longer
return IST_NULL when the port is empty. Now, a ist is returned, it points on
the first character after the colon (':') with a length of 0. In addition,
http_is_default_port() now considers an empty port as a default port,
regardless the scheme.

This patch must not be backported, if so, without the previous one ("MINOR:
h1: Consider empty port as invalid in authority for CONNECT").
src/http.c