From c0563220377be1bf22a66f968c2143f4e426c4a6 Mon Sep 17 00:00:00 2001 From: Ben Busby Date: Mon, 30 Sep 2024 11:59:14 -0600 Subject: [PATCH] Use `.lower()` when accessing the cache busting map Cache busted resources will always have a lowercase name. For some reason, a user encountered a capitalized css file name in #1142. This isn't present anywhere in the Whoogle repo, but could be a byproduct of some self-hosting configuration. Either way, the key used should always be lowercase. Fixes #1142 --- app/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/__init__.py b/app/__init__.py index db58385..2e661dd 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -176,7 +176,7 @@ for cb_dir in cache_busting_dirs: # Templating functions app.jinja_env.globals.update(clean_query=clean_query) app.jinja_env.globals.update( - cb_url=lambda f: app.config['CACHE_BUSTING_MAP'][f]) + cb_url=lambda f: app.config['CACHE_BUSTING_MAP'][f.lower()]) # Attempt to acquire tor identity, to determine if Tor config is available send_tor_signal(Signal.HEARTBEAT)