From 0dcf64cf8ecc663e65c1113d54d69f9754d6e207 Mon Sep 17 00:00:00 2001 From: Solirs Date: Wed, 22 Mar 2023 11:02:02 +0100 Subject: [PATCH] Improve readability in get_favicon_or_logo() --- searx/webapp.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/searx/webapp.py b/searx/webapp.py index 60978266b..fe80602ae 100755 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -298,6 +298,7 @@ def get_result_template(theme_name: str, template_name: str): return themed_path return 'result_templates/' + template_name + def get_favicon_or_logo(imgtype: str, request): # This method returns a favicon or regular image depending on the imgtype parameter # It is used to not repeat code for /favicon.ico and /logo @@ -316,12 +317,10 @@ def get_favicon_or_logo(imgtype: str, request): ) else: # Otherwise we're good to go, send whatever is specified. - filename = os.path.basename(path) - path = os.path.dirname(path) # Works with both relative and absolute. return send_from_directory( - path, - filename, + os.path.dirname(path), + os.path.basename(path), mimetype=mimetype )