The servers used in tests are only listening for ipv4, not ipv6
(to avoid spurious firewall prompts on macos). In what is apparently
a recent macos change, connecting to `localhost` when the ipv6 port
is unbound now incurs a 200ms delay, slowing a full test run down
by a factor of 20.
self.assertNotIn("Content-Length", response.headers)
def test_host_header(self):
- host_re = re.compile(b"^localhost:[0-9]+$")
+ host_re = re.compile(b"^127.0.0.1:[0-9]+$")
response = self.fetch("/host_echo")
self.assertTrue(host_re.match(response.body))
response = self.wait()
self.assertEqual(response.code, 302)
self.assertTrue(re.match(
- 'http://example.com/login\?next=http%3A%2F%2Flocalhost%3A[0-9]+%2Fabsolute',
+ 'http://example.com/login\?next=http%3A%2F%2F127.0.0.1%3A[0-9]+%2Fabsolute',
response.headers['Location']), response.headers['Location'])
def get_url(self, path):
"""Returns an absolute url for the given path on the test server."""
- return '%s://localhost:%s%s' % (self.get_protocol(),
+ return '%s://127.0.0.1:%s%s' % (self.get_protocol(),
self.get_http_port(), path)
def tearDown(self):