Skip to content
Myr

Pass true for res.sendfile() callback when streamed

Before adoption: this commit came in with the history the project adopted, so no landing records it.

This is potentially useful since we can no longer respond, however with readFile() we can respond with a 500 page or similar

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent f0eab06 · Browse files · 1 file+1 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:lib/express/response.js+1 added-1 removed
151 unmodified lines
152 self.contentType(path);153 self.header('Content-Length', stat.size);154 self.writeHead(200, self.headers);155 pump(stream, self, function(err){156 fn && fn(err, path);156 fn && fn(err, path, true);157 });158 } else {159 fs.readFile(path, function(err, buf){160 if (err) return error(err);
181 unmodified lines