--- http.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/http.c b/http.c index 12ebde8..f3a596f 100644 --- a/http.c +++ b/http.c _AT_@ -401,6 +401,14 @@ http_send_response(int fd, struct request *r) } } + /* check for IPv6 address (RFC 3986, 2732), then strip the port + * out of the host name */ + if ((r->field[REQ_HOST][0] == '[' && + (p = strchr(r->field[REQ_HOST], ']')) && *++p == ':') || + (p = strchr(r->field[REQ_HOST], ':'))) { + *p = '\0'; + } + /* redirect if targets differ, host is non-canonical or we prefixed */ if (strcmp(r->target, realtarget) || (s.vhost && vhostmatch && strcmp(r->field[REQ_HOST], vhostmatch))) { -- 2.10.0Received on Mon Apr 02 2018 - 15:34:08 CEST
This archive was generated by hypermail 2.3.0 : Mon Apr 02 2018 - 15:48:23 CEST