Skip to content

Commit 2895a67

Browse files
authored
bugfix : Cannot res.send() in on End event
bug fix : #73
1 parent df35fd8 commit 2895a67

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/filehandler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module.exports = function (middleware, options) {
1010
if (redirect) {
1111
files = {files: result};
1212
res.redirect(redirect.replace(/%s/, encodeURIComponent(JSON.stringify(files))));
13-
} else {
13+
} else if (!res.finished){
1414
res.set({
1515
'Content-Type': (req.headers.accept || '').indexOf('application/json') !== -1
1616
? 'application/json'

0 commit comments

Comments
 (0)