mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-12 15:44:06 -08:00
fix(Compression Node): Fix issue with decompression failing with uppercase extensions (#6098)
This commit is contained in:
parent
25a386dd70
commit
aa59329836
|
@ -52,7 +52,7 @@ export class Compression implements INodeType {
|
||||||
group: ['transform'],
|
group: ['transform'],
|
||||||
subtitle: '={{$parameter["operation"]}}',
|
subtitle: '={{$parameter["operation"]}}',
|
||||||
version: 1,
|
version: 1,
|
||||||
description: 'Compress and uncompress files',
|
description: 'Compress and decompress files',
|
||||||
defaults: {
|
defaults: {
|
||||||
name: 'Compression',
|
name: 'Compression',
|
||||||
color: '#408000',
|
color: '#408000',
|
||||||
|
@ -197,7 +197,7 @@ export class Compression implements INodeType {
|
||||||
const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
|
const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
|
||||||
const binaryDataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
|
const binaryDataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
|
||||||
|
|
||||||
if (binaryData.fileExtension === 'zip') {
|
if (binaryData.fileExtension?.toLowerCase() === 'zip') {
|
||||||
const files = await unzip(binaryDataBuffer);
|
const files = await unzip(binaryDataBuffer);
|
||||||
|
|
||||||
for (const key of Object.keys(files)) {
|
for (const key of Object.keys(files)) {
|
||||||
|
@ -213,7 +213,7 @@ export class Compression implements INodeType {
|
||||||
|
|
||||||
binaryObject[`${outputPrefix}${zipIndex++}`] = data;
|
binaryObject[`${outputPrefix}${zipIndex++}`] = data;
|
||||||
}
|
}
|
||||||
} else if (binaryData.fileExtension === 'gz') {
|
} else if (binaryData.fileExtension?.toLowerCase() === 'gz') {
|
||||||
const file = await gunzip(binaryDataBuffer);
|
const file = await gunzip(binaryDataBuffer);
|
||||||
|
|
||||||
const fileName = binaryData.fileName?.split('.')[0];
|
const fileName = binaryData.fileName?.split('.')[0];
|
||||||
|
|
Loading…
Reference in a new issue