Browse Source

fix: invalid char in content-disposition header

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/2292/head
Raju Udava 3 years ago
parent
commit
f9ef9855df
  1. 4
      packages/nocodb/src/lib/meta/NcMetaMgr.ts
  2. 4
      packages/nocodb/src/lib/meta/api/dataApis/dataAliasExportApis.ts
  3. 4
      packages/nocodb/src/lib/meta/api/exportApis.ts
  4. 4
      packages/nocodb/src/lib/meta/api/publicApis/publicDataExportApis.ts

4
packages/nocodb/src/lib/meta/NcMetaMgr.ts

@ -4551,7 +4551,9 @@ export default class NcMetaMgr {
'Access-Control-Expose-Headers': 'nc-export-offset', 'Access-Control-Expose-Headers': 'nc-export-offset',
'nc-export-offset': csvData.offset, 'nc-export-offset': csvData.offset,
'nc-export-elapsed-time': csvData.elapsed, 'nc-export-elapsed-time': csvData.elapsed,
'Content-Disposition': `attachment; filename="${args.args.model_name}-export.csv"` 'Content-Disposition': `attachment; filename="${encodeURI(
args.args.model_name
)}-export.csv"`
}); });
res.send(csvData.data); res.send(csvData.data);
} }

4
packages/nocodb/src/lib/meta/api/dataApis/dataAliasExportApis.ts

@ -15,7 +15,9 @@ async function csvDataExport(req: Request, res: Response) {
'Access-Control-Expose-Headers': 'nc-export-offset', 'Access-Control-Expose-Headers': 'nc-export-offset',
'nc-export-offset': offset, 'nc-export-offset': offset,
'nc-export-elapsed-time': elapsed, 'nc-export-elapsed-time': elapsed,
'Content-Disposition': `attachment; filename="${view.title}-export.csv"` 'Content-Disposition': `attachment; filename="${encodeURI(
view.title
)}-export.csv"`
}); });
res.send(data); res.send(data);
} }

4
packages/nocodb/src/lib/meta/api/exportApis.ts

@ -11,7 +11,9 @@ async function exportCsv(req: Request, res: Response) {
'Access-Control-Expose-Headers': 'nc-export-offset', 'Access-Control-Expose-Headers': 'nc-export-offset',
'nc-export-offset': offset, 'nc-export-offset': offset,
'nc-export-elapsed-time': elapsed, 'nc-export-elapsed-time': elapsed,
'Content-Disposition': `attachment; filename="${view.title}-export.csv"` 'Content-Disposition': `attachment; filename="${encodeURI(
view.title
)}-export.csv"`
}); });
res.send(data); res.send(data);
} }

4
packages/nocodb/src/lib/meta/api/publicApis/publicDataExportApis.ts

@ -122,7 +122,9 @@ async function exportCsv(req: Request, res: Response) {
'Access-Control-Expose-Headers': 'nc-export-offset', 'Access-Control-Expose-Headers': 'nc-export-offset',
'nc-export-offset': offset, 'nc-export-offset': offset,
'nc-export-elapsed-time': elapsed, 'nc-export-elapsed-time': elapsed,
'Content-Disposition': `attachment; filename="${view.title}-export.csv"` 'Content-Disposition': `attachment; filename="${encodeURI(
view.title
)}-export.csv"`
}); });
res.send(data); res.send(data);
} }

Loading…
Cancel
Save