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
main
Ben Busby 2024-09-30 11:59:14 -06:00
parent 5eb609d0b2
commit c056322037
No known key found for this signature in database
GPG Key ID: B9B7231E01D924A1
1 changed files with 1 additions and 1 deletions

View File

@ -176,7 +176,7 @@ for cb_dir in cache_busting_dirs:
# Templating functions # Templating functions
app.jinja_env.globals.update(clean_query=clean_query) app.jinja_env.globals.update(clean_query=clean_query)
app.jinja_env.globals.update( 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 # Attempt to acquire tor identity, to determine if Tor config is available
send_tor_signal(Signal.HEARTBEAT) send_tor_signal(Signal.HEARTBEAT)