diff options
Diffstat (limited to 'searx/webapp.py')
| -rwxr-xr-x | searx/webapp.py | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/searx/webapp.py b/searx/webapp.py index 3b4cf1604..aaa2608c4 100755 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -7,8 +7,6 @@ from __future__ import annotations import inspect -import hashlib -import hmac import json import os import sys @@ -261,24 +259,6 @@ def custom_url_for(endpoint: str, **values): return url_for(endpoint, **values) + suffix -def morty_proxify(url: str): - if not url: - return url - - if url.startswith('//'): - url = 'https:' + url - - if not settings['result_proxy']['url']: - return url - - url_params = dict(mortyurl=url) - - if settings['result_proxy']['key']: - url_params['mortyhash'] = hmac.new(settings['result_proxy']['key'], url.encode(), hashlib.sha256).hexdigest() - - return '{0}?{1}'.format(settings['result_proxy']['url'], urlencode(url_params)) - - def image_proxify(url: str): if not url: return url @@ -300,9 +280,6 @@ def image_proxify(url: str): return url return None - if settings['result_proxy']['url']: - return morty_proxify(url) - h = new_hmac(settings['server']['secret_key'], url.encode()) return '{0}?{1}'.format(url_for('image_proxy'), urlencode(dict(url=url.encode(), h=h))) @@ -424,8 +401,6 @@ def render(template_name: str, **kwargs): kwargs['url_for'] = custom_url_for # override url_for function in templates kwargs['image_proxify'] = image_proxify kwargs['favicon_url'] = favicons.favicon_url - kwargs['proxify'] = morty_proxify if settings['result_proxy']['url'] is not None else None - kwargs['proxify_results'] = settings['result_proxy']['proxify_results'] kwargs['cache_url'] = settings['ui']['cache_url'] kwargs['get_result_template'] = get_result_template kwargs['opensearch_url'] = ( |