From a928b671f4fdeabf99cec3c28d10582d5e2becfc Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Mon, 4 Sep 2023 11:28:02 +0200 Subject: make an old article about Ethereum viewable again --- src/koszko_org_website/app.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/koszko_org_website') 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('/', 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 '/'. -- cgit v1.2.3