From: Zooko O'Whielacronx Date: Tue, 11 Mar 2008 13:18:03 +0000 (-0700) Subject: make the nodeurl start with '127.0.0.1' instead of with 'localhost' X-Git-Tag: allmydata-tahoe-0.9.0~29 X-Git-Url: https://git.rkrishnan.org/%5B/%5D%20/index.php?a=commitdiff_plain;h=a8a85da32635e2a72dc823881958608895ecbd95;p=tahoe-lafs%2Ftahoe-lafs.git make the nodeurl start with '127.0.0.1' instead of with 'localhost' This is because there exist in the wild computers that are misconfigured so that 'localhost' doesn't resolve to 127.0.0.1. On those computers, using 'localhost' for the nodeurl is a security problem, because the user commonly sends valuable caps to the nodeurl. --- diff --git a/src/allmydata/webish.py b/src/allmydata/webish.py index f591cf65..89935fb1 100644 --- a/src/allmydata/webish.py +++ b/src/allmydata/webish.py @@ -1579,9 +1579,9 @@ class WebishServer(service.MultiService): # what is our webport? s = self.listener if isinstance(s, internet.TCPServer): - base_url = "http://localhost:%d" % s._port.getHost().port + base_url = "http://127.0.0.1:%d" % s._port.getHost().port elif isinstance(s, internet.SSLServer): - base_url = "https://localhost:%d" % s._port.getHost().port + base_url = "https://127.0.0.1:%d" % s._port.getHost().port else: base_url = None if base_url: