fixed content-disposition filename encoding

This commit is contained in:
uh wot 2023-07-01 21:49:22 +02:00
parent 7f6c507926
commit fb190ef605
Signed by: uhwot
GPG Key ID: CB2454984587B781
1 changed files with 3 additions and 1 deletions

View File

@ -256,12 +256,14 @@ async function track(env, id, format, tagging, range_header) {
let title = json.SNG_TITLE
if (json.VERSION) title += ` ${json.VERSION}`
const filename = `${title} [${id}].${formats[format].ext}`
let init = { method: 'GET', headers: {} }
let resp_init = {
status: 200,
headers: {
'content-type': formats[format].mime,
'content-disposition': `inline; filename="${title.replaceAll('"', '\\"')} [${id}].${formats[format].ext}"`,
'content-disposition': `inline; filename*=utf-8''${encodeURIComponent(filename)}`,
'accept-ranges': 'bytes'
}
}