config: support omitting the excluded routes

This commit is contained in:
Kay Faraday 2021-12-03 05:00:22 +00:00
parent e1753f26cb
commit be4c6cdeb8
1 changed files with 4 additions and 1 deletions

View File

@ -27,7 +27,10 @@ def load_config():
host['repl_decoded'] = host['repl']
host['repl'] = host['repl'].encode()
host['mime_types'] = frozenset(host.get('mime_types', ()))
host['excluded_routes'].sort(key=len, reverse=True)
try:
host['excluded_routes'].sort(key=len, reverse=True)
except KeyError:
host['excluded_routes'] = ()
return config