mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
port previous css workaround to flask
This commit is contained in:
parent
e45c939649
commit
14602be0ca
1 changed files with 7 additions and 1 deletions
|
@ -138,7 +138,13 @@ def allroutes(pathin):
|
|||
response.headers["Content-Type"] = "application/binary"
|
||||
return response
|
||||
|
||||
return flask.send_file(fullpath, conditional=True)
|
||||
if fullpath.endswith(".css"):
|
||||
# some users may have invalid mime type in the Windows registry
|
||||
mimetype = "text/css"
|
||||
else:
|
||||
# autodetect
|
||||
mimetype = None
|
||||
return flask.send_file(fullpath, mimetype=mimetype, conditional=True)
|
||||
|
||||
except Exception as error:
|
||||
if devMode:
|
||||
|
|
Loading…
Reference in a new issue