mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 10:09:20 +02:00
Fix #705: Can now use a local file with FUNKWHALE_SPA_HTML_ROOT to avoid sending an HTTP request
This commit is contained in:
parent
d702f8f69f
commit
d99757658c
3 changed files with 11 additions and 0 deletions
|
@ -56,6 +56,10 @@ def serve_spa(request):
|
|||
|
||||
|
||||
def get_spa_html(spa_url):
|
||||
if spa_url.startswith("/"):
|
||||
# we try to open a local file
|
||||
with open(spa_url) as f:
|
||||
return f.read()
|
||||
cache_key = "spa-html:{}".format(spa_url)
|
||||
cached = caches["local"].get(cache_key)
|
||||
if cached:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue