When client address is received, IPv6 address could be specified without
square brackets and without port, as well as both with the brackets and
port. The change allows IPv6 in square brackets and no port, which was
previously considered an error. This format conforms to RFC 3986.
The change also affects proxy_bind and friends.
p = ngx_strlchr(text, last, ']');
- if (p == NULL || p == last - 1 || *++p != ':') {
+ if (p == last - 1) {
+ return ngx_parse_addr(pool, addr, text + 1, len - 2);
+ }
+
+ if (p == NULL || *++p != ':') {
return NGX_DECLINED;
}