mirror of
https://github.com/krateng/maloja.git
synced 2025-04-12 07:00:02 +03:00
Read out mimetypes for cached images
On Firefox, because there is no mimetype set when serving the file, it is served up as raw HTML, causing cached images to not be served to the client (as the fetch is aborted early). It doesn't appear to be an issue in Google Chrome. This commit fixes #349 .
This commit is contained in:
parent
126d155208
commit
a8293063a5
@ -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():
|
||||
|
Loading…
x
Reference in New Issue
Block a user