fix(core): Handle filename* with quotes in Content-Disposition header (#7229)

Github issue / Community forum post (link here to close automatically):
This commit is contained in:
Elias Meire
2023-09-21 14:54:10 +02:00
committed by GitHub
parent 2af967cf88
commit 67b985fe89
2 changed files with 16 additions and 1 deletions

View File

@@ -174,6 +174,21 @@ describe('NodeExecuteFunctions', () => {
});
});
it('parses valid content-disposition header with filename* (quoted)', () => {
const message = mock<IncomingMessage>({
headers: {
'content-type': undefined,
'content-disposition': ' attachment;filename*="utf-8\' \'test-unsplash.jpg"',
},
});
parseIncomingMessage(message);
expect(message.contentDisposition).toEqual({
filename: 'test-unsplash.jpg',
type: 'attachment',
});
});
it('parses valid content-disposition header with filename and trailing ";"', () => {
const message = mock<IncomingMessage>({
headers: {