fix(core): Account for non-ASCII chars in filename on binary data download (#7742)
https://n8nio.sentry.io/issues/4641538638
This commit is contained in:
@@ -41,8 +41,9 @@ export class BinaryDataController {
|
||||
|
||||
if (mimeType) res.setHeader('Content-Type', mimeType);
|
||||
|
||||
if (action === 'download') {
|
||||
res.setHeader('Content-Disposition', `attachment; filename="${fileName}"`);
|
||||
if (action === 'download' && fileName) {
|
||||
const encodedFilename = encodeURIComponent(fileName);
|
||||
res.setHeader('Content-Disposition', `attachment; filename="${encodedFilename}"`);
|
||||
}
|
||||
|
||||
return await this.binaryDataService.getAsStream(binaryDataId);
|
||||
|
||||
Reference in New Issue
Block a user