Skip to content

Commit

Permalink
fixup! Fix web-platform-tests#2669: Add alternate_hosts
Browse files Browse the repository at this point in the history
  • Loading branch information
gsnedders committed Apr 30, 2018
1 parent a9d3389 commit daf7e34
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions tools/serve/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,13 @@ def is_alive(self):
return self.proc.is_alive()


def check_subdomains(domains, paths, bind_address, ssl_config, aliases):
domains = domains.copy()
host = domains[""][""]
def check_subdomains(config):
paths = config.paths
bind_address = config.bind_address
ssl_config = config.ssl_config
aliases = config.aliases

host = config.server_host
port = get_port(host)
logger.debug("Going to use port %d to check subdomains" % port)

Expand All @@ -423,7 +427,7 @@ def check_subdomains(domains, paths, bind_address, ssl_config, aliases):
"You may need to edit /etc/hosts or similar, see README.md." % (host, port))
sys.exit(1)

for domain in domains_set.itervalues():
for domain in config.domains_set:
if domain == host:
continue

Expand Down Expand Up @@ -698,9 +702,7 @@ def run(**kwargs):
bind_address = config["bind_address"]

if config["check_subdomains"]:
paths = config.paths
ssl_config = config.ssl_config
check_subdomains(config.domains, paths, bind_address, ssl_config, config["aliases"])
check_subdomains(config)

stash_address = None
if bind_address:
Expand Down

0 comments on commit daf7e34

Please sign in to comment.