Skip to content

Commit

Permalink
Rename internal variable
Browse files Browse the repository at this point in the history
  • Loading branch information
kanongil committed Jan 15, 2018
1 parent c2a2703 commit 302b1e0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/file.js
Expand Up @@ -150,19 +150,19 @@ internals.marshal = async function (response) {
const encoding = response.request.info.acceptEncoding;
const extension = lookupMap.hasOwnProperty(encoding) ? lookupMap[encoding] : null;
if (extension) {
const gzFile = new Fs.File(`${response.source.path}${extension}`);
const precompressed = new Fs.File(`${response.source.path}${extension}`);
let stat;
try {
stat = await gzFile.openStat('r');
stat = await precompressed.openStat('r');
}
catch (err) {
gzFile.close();
precompressed.close();
Bounce.ignore(err, 'boom');
}

if (stat) {
response.source.file.close();
response.source.file = gzFile;
response.source.file = precompressed;

response.bytes(stat.size);
response.header('content-encoding', encoding);
Expand Down

0 comments on commit 302b1e0

Please sign in to comment.