diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/koszko_org_website/app.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/koszko_org_website/app.py b/src/koszko_org_website/app.py index ed80561..dfda351 100644 --- a/src/koszko_org_website/app.py +++ b/src/koszko_org_website/app.py @@ -173,9 +173,9 @@ for lang in langs_short_2_long.keys(): @website_app.route('/<path:page_path>', methods=['GET']) def redirect_to_resource(page_path) -> werkzeug.Response: if page_path != '': - path_start = PurePosixPath(page_path).parts[0] + page_path_posix = PurePosixPath(page_path) - if path_start == 'sideload': + if page_path_posix.parts[0] == 'sideload': return flask.Response( "Incomplete server configuration - requests for '/sideload/' not routed as they should be.", 500 @@ -183,8 +183,12 @@ def redirect_to_resource(page_path) -> werkzeug.Response: # Route to other stuff that was on this domain before and has been moved # under '/sideload/'. - for name in ['fraktal', 'mm']: - if path_start == name: + for name in ['fraktal', 'mm', 'articles/etherwall_private_chain.html']: + try: + page_path_posix.relative_to(PurePosixPath(name)) + except ValueError: + pass + else: return flask.redirect(f'/sideload/{name}') # Make all resources from '/static' aliased under '/'. |