use lib for setting content-disposition for more correctness

This commit is contained in:
Danny Coates 2018-07-19 12:11:55 -07:00
parent f12d3abe79
commit 282cf0b595
No known key found for this signature in database
GPG Key ID: 4C442633C62E00CB
2 changed files with 3 additions and 1 deletions

View File

@ -1,6 +1,7 @@
import Keychain from './keychain';
import { downloadStream } from './api';
import { transform } from './streams';
import contentDisposition from 'content-disposition';
let noSave = false;
const map = new Map();
@ -32,7 +33,7 @@ async function decryptStream(request) {
const decrypted = keychain.decryptStream(readStream);
const headers = {
'Content-Disposition': 'attachment; filename=' + file.filename,
'Content-Disposition': contentDisposition(file.filename),
'Content-Type': file.type,
'Content-Length': file.size
};

View File

@ -67,6 +67,7 @@
"babel-preset-stage-2": "^6.24.1",
"babel-preset-stage-3": "^6.24.1",
"base64-js": "^1.3.0",
"content-disposition": "^0.5.2",
"copy-webpack-plugin": "^4.5.2",
"cross-env": "^5.2.0",
"css-loader": "^1.0.0",