Small improvements

pull/7571/merge
Diego Sampaio 9 years ago
parent 558958622d
commit 492585e113
No known key found for this signature in database
GPG Key ID: E060152B30502562
  1. 1
      packages/rocketchat-file-upload/server/config/GridFS.js
  2. 4
      packages/rocketchat-file-upload/server/lib/FileUpload.js

@ -73,7 +73,6 @@ const readFromGridFS = function(storeName, fileId, file, headers, req, res) {
const ws = new stream.PassThrough();
[rs, ws].forEach(stream => stream.on('error', function(err) {
console.log('error');
store.onReadError.call(store, err, fileId, file);
res.end();
}));

@ -185,11 +185,9 @@ Object.assign(FileUpload, {
get(file, req, res, next) {
const store = this.getStoreByName(file.store);
// if (file.store && this.handlers && this.handlers[file.store] && this.handlers[file.store].get) {
if (store && store.get) {
if (store) {
return store.get(file, req, res, next);
}
// }
res.writeHead(404);
res.end();
}

Loading…
Cancel
Save