diff options
author | Wojtek Kosior <koszko@koszko.org> | 2023-09-04 11:28:02 +0200 |
---|---|---|
committer | W. Kosior <koszko@koszko.org> | 2025-07-03 20:37:02 +0200 |
commit | fc3c940c2a19d0e95b2e95ba71320e9b9bb79900 (patch) | |
tree | c95ff72221aa36f99b17b0b2593f1ce36fcaf8af /src/koszko_org_website | |
parent | 2c29f05389746352e30a0afd84802b030a6673e9 (diff) | |
download | koszko-org-website-master.tar.gz koszko-org-website-master.zip |
make an old article about Ethereum viewable againHEADv2025.7.3.1master
Diffstat (limited to 'src/koszko_org_website')
-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 2d1501c..de32580 100644 --- a/src/koszko_org_website/app.py +++ b/src/koszko_org_website/app.py @@ -196,9 +196,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 @@ -206,8 +206,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 '/'. |