1
0
mirror of https://github.com/krateng/maloja.git synced 2023-08-10 21:12:55 +03:00

Added more generalized support for static user files, GH-135

This commit is contained in:
krateng 2022-04-26 19:41:23 +02:00
parent 02c77a5e31
commit 0c948561a8

View File

@ -182,6 +182,15 @@ def static(path):
response.set_header("Cache-Control", "public, max-age=3600")
return response
# static files not supplied by the package
@webserver.get("/static_custom/<category>/<path:path>")
def static_custom(category,path):
rootpath = {
'css':data_dir['css']()
}
response = static_file(path,root=rootpath[category])
response.set_header("Cache-Control", "public, max-age=3600")
return response
### DYNAMIC