From 2490089645f2cc2659f75be1398d13bbb6fec726 Mon Sep 17 00:00:00 2001 From: Ben Busby Date: Tue, 26 Apr 2022 16:28:04 -0600 Subject: [PATCH] Remove unused `/url` endpoint The `/url` endpoint was previously used as a way of mirroring the `/url?q=` formatting of locations in search results from Google. Rather than have this unnecessary intermediary step, the result path was extracted and used as the immediate path for each result item instead. This endpoint hasn't been in use for many versions and has been in need of removal for quite some time. --- app/routes.py | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/app/routes.py b/app/routes.py index aa84a43..7802828 100644 --- a/app/routes.py +++ b/app/routes.py @@ -432,22 +432,6 @@ def config(): return redirect(url_for('.index'), code=403) -@app.route(f'/{Endpoint.url}', methods=['GET']) -@session_required -@auth_required -def url(): - if 'url' in request.args: - return redirect(request.args.get('url')) - - q = request.args.get('q') - if len(q) > 0 and 'http' in q: - return redirect(q) - else: - return render_template( - 'error.html', - error_message='Unable to resolve query: ' + q) - - @app.route(f'/{Endpoint.imgres}') @session_required @auth_required