mirror of
https://github.com/krateng/maloja.git
synced 2025-07-09 03:04:07 -04: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 \
|
apk add --no-cache \
|
||||||
python3 \
|
python3 \
|
||||||
py3-lxml \
|
py3-lxml \
|
||||||
|
libmagic \
|
||||||
tzdata && \
|
tzdata && \
|
||||||
echo "" && \
|
echo "" && \
|
||||||
echo "**** install pip dependencies ****" && \
|
echo "**** install pip dependencies ****" && \
|
||||||
|
@ -3,6 +3,7 @@ import os
|
|||||||
from threading import Thread
|
from threading import Thread
|
||||||
from importlib import resources
|
from importlib import resources
|
||||||
import time
|
import time
|
||||||
|
from magic import from_file
|
||||||
|
|
||||||
|
|
||||||
# server stuff
|
# server stuff
|
||||||
@ -154,7 +155,8 @@ def static_image(pth):
|
|||||||
|
|
||||||
@webserver.route("/cacheimages/<uuid>")
|
@webserver.route("/cacheimages/<uuid>")
|
||||||
def static_proxied_image(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")
|
@webserver.route("/login")
|
||||||
def login():
|
def login():
|
||||||
|
@ -8,6 +8,7 @@ lru-dict==1.3.*
|
|||||||
psutil==5.9.*
|
psutil==5.9.*
|
||||||
sqlalchemy==2.0
|
sqlalchemy==2.0
|
||||||
python-datauri==3.0.*
|
python-datauri==3.0.*
|
||||||
|
python-magic==0.4.*
|
||||||
requests==2.32.*
|
requests==2.32.*
|
||||||
toml==0.10.*
|
toml==0.10.*
|
||||||
PyYAML==6.0.*
|
PyYAML==6.0.*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user