mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
send charset=utf8 for css, js files
This commit is contained in:
parent
e0a14ec881
commit
177aa038df
|
@ -1030,7 +1030,13 @@ def guess_mime(url, fallback="application/octet-stream"):
|
|||
except:
|
||||
return fallback
|
||||
|
||||
return MIMES.get(ext) or mimetypes.guess_type(url)[0] or fallback
|
||||
ret = MIMES.get(ext) or mimetypes.guess_type(url)[0] or fallback
|
||||
|
||||
if ";" not in ret:
|
||||
if ret.startswith("text/") or ret.endswith("/javascript"):
|
||||
ret += "; charset=UTF-8"
|
||||
|
||||
return ret
|
||||
|
||||
|
||||
def runcmd(*argv):
|
||||
|
|
|
@ -1664,7 +1664,7 @@ document.onkeydown = function (e) {
|
|||
if (e.ctrlKey || e.altKey || e.shiftKey || e.metaKey || e.isComposing)
|
||||
return;
|
||||
|
||||
var k = (e.code + ''), pos = -1;
|
||||
var k = (e.code + ''), pos = -1, n;
|
||||
if (k.indexOf('Digit') === 0)
|
||||
pos = parseInt(k.slice(-1)) * 0.1;
|
||||
|
||||
|
|
Loading…
Reference in a new issue