fix matching an IPv6 address as host

When the host is something like `[::1]` or `[::1]:8080`, `_get_host_handlers` gets wrong hosts string.