if ":" in env['CLIENT_ADDR']:  # enclose with brackets if ipv6
            env["CLIENT_ADDR"] = "[%s]" % env["CLIENT_ADDR"]