1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-15 00:03:28 +01:00

pywb_init: ensure root route works with liveweb and custom handlers also

This commit is contained in:
Ilya Kreymer 2015-04-17 12:20:49 -07:00
parent 7bf8b97cb0
commit 8485a8dd80

View File

@ -284,7 +284,11 @@ def create_wb_router(passed_config=None):
for name, value in collections.iteritems():
if isinstance(value, BaseHandler):
handler_dict[name] = value
routes.append(Route(name, value, config=config))
new_route = Route(name, value, config=config)
if name != '':
routes.append(new_route)
else:
root_route = new_route
continue
route_config = init_route_config(value, config)
@ -293,7 +297,11 @@ def create_wb_router(passed_config=None):
if route_config.get('index_paths') == '$liveweb':
live = create_live_handler(route_config)
handler_dict[name] = live
routes.append(route_class(name, live, config=route_config))
new_route = route_class(name, live, config=route_config)
if name != '':
routes.append(new_route)
else:
root_route = new_route
continue
query_handler = init_collection(route_config)