mirror of
https://github.com/krateng/maloja.git
synced 2025-04-12 07:00:02 +03:00
Merge pull request #399 from noirscape/patch-1
Read out mimetypes for cached images
This commit is contained in:
commit
ca65813619
@ -29,6 +29,7 @@ RUN \
|
||||
apk add --no-cache \
|
||||
python3 \
|
||||
py3-lxml \
|
||||
libmagic \
|
||||
tzdata && \
|
||||
echo "" && \
|
||||
echo "**** install pip dependencies ****" && \
|
||||
|
@ -3,6 +3,7 @@ import os
|
||||
from threading import Thread
|
||||
from importlib import resources
|
||||
import time
|
||||
from magic import from_file
|
||||
|
||||
|
||||
# server stuff
|
||||
@ -154,7 +155,8 @@ def static_image(pth):
|
||||
|
||||
@webserver.route("/cacheimages/<uuid>")
|
||||
def static_proxied_image(uuid):
|
||||
return static_file(uuid,root=data_dir['cache']('images'))
|
||||
mimetype = from_file(os.path.join(data_dir['cache']('images'),uuid),True)
|
||||
return static_file(uuid,root=data_dir['cache']('images'),mimetype=mimetype)
|
||||
|
||||
@webserver.route("/login")
|
||||
def login():
|
||||
|
@ -8,6 +8,7 @@ lru-dict==1.3.*
|
||||
psutil==5.9.*
|
||||
sqlalchemy==2.0
|
||||
python-datauri==3.0.*
|
||||
python-magic==0.4.*
|
||||
requests==2.32.*
|
||||
toml==0.10.*
|
||||
PyYAML==6.0.*
|
||||
|
Loading…
x
Reference in New Issue
Block a user