mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2024-12-12 09:26:33 +01:00
#2127 Encode export PNG name
This commit is contained in:
parent
2bba186c9e
commit
530bf81940
@ -1098,7 +1098,7 @@ router.post('/export', jsonParser, async function (request, response) {
|
||||
const fileContent = await fsPromises.readFile(filename);
|
||||
const contentType = mime.lookup(filename) || 'image/png';
|
||||
response.setHeader('Content-Type', contentType);
|
||||
response.setHeader('Content-Disposition', `attachment; filename=${path.basename(filename)}`);
|
||||
response.setHeader('Content-Disposition', `attachment; filename="${encodeURI(path.basename(filename))}"`);
|
||||
return response.send(fileContent);
|
||||
}
|
||||
case 'json': {
|
||||
|
Loading…
Reference in New Issue
Block a user