- commit
- 2659510c3c9768d2c99ff050a2318660ba4e97d7
- parent
- c3c3949a03ab5ed48dc9569156a85c603b8a8f76
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2023-10-03 05:37
fix trailing slash
Diffstat
M | neddit.py | 5 | +++-- |
1 files changed, 3 insertions, 2 deletions
diff --git a/neddit.py b/neddit.py
@@ -91,7 +91,7 @@ async def fetch_subreddit(name): 91 91 92 92 93 93 async def generic(request):94 -1 path = request.match_info['path'] or 'hot'-1 94 path = request.path.strip('/') or 'hot' 95 95 context = { 96 96 'params': request.query, 97 97 } @@ -119,5 +119,6 @@ if __name__ == '__main__': 119 119 120 120 app = web.Application() 121 121 app.router.add_static('/static', BASE_DIR / 'static')122 -1 app.router.add_route('GET', '/{path:.*}', generic)-1 122 app.router.add_route('GET', '', generic) -1 123 app.router.add_route('GET', '/{path:.*}/', generic) 123 124 web.run_app(app, host='localhost', port=args.port)