Only generate lowercase hostnames in register_wrapper_cap()

Hostnames are case insensitive and passing a URL through urlparse()
will always give you a lowercase domain name.
This commit is contained in:
Salad Dais
2021-06-11 17:52:03 +00:00
parent 52679bf708
commit cb8c1cfe91

View File

@@ -121,7 +121,7 @@ class ProxiedRegion(BaseClientRegion):
parsed = list(urllib.parse.urlsplit(self._caps[name][1]))
seed_id = self._caps["Seed"][1].split("/")[-1].encode("utf8")
# Give it a unique domain tied to the current Seed URI
parsed[1] = f"{name}-{hashlib.sha256(seed_id).hexdigest()[:16]}.hippo-proxy.localhost"
parsed[1] = f"{name.lower()}-{hashlib.sha256(seed_id).hexdigest()[:16]}.hippo-proxy.localhost"
# Force the URL to HTTP, we're going to handle the request ourselves so it doesn't need
# to be secure. This should save on expensive TLS context setup for each req.
parsed[0] = "http"