aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2023-09-04 11:28:02 +0200
committerWojtek Kosior <koszko@koszko.org>2023-09-05 18:06:59 +0200
commita928b671f4fdeabf99cec3c28d10582d5e2becfc (patch)
treed8ba3a7cdc290062a9ebde1bdb2480dd72f947bc
parent40b0ff64964763e08000a52062166b2f82306541 (diff)
downloadkoszko-org-website-a928b671f4fdeabf99cec3c28d10582d5e2becfc.tar.gz
koszko-org-website-a928b671f4fdeabf99cec3c28d10582d5e2becfc.zip
make an old article about Ethereum viewable again
-rw-r--r--src/koszko_org_website/app.py12
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 '/'.