Skip to content

Commit

Permalink
Make --cache work again
Browse files Browse the repository at this point in the history
This closes #102
  • Loading branch information
leo committed Feb 10, 2017
1 parent 90e2add commit 38cc9a3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,13 @@ module.exports = async (req, res, flags, current, ignoredFiles) => {
// Serve files without a mime type as text
stream.mime.default_type = 'text/plain'

return stream(req, related, {
const streamOptions = {
dotfiles: 'allow'
}).pipe(res)
}

if (flags.cache) {
streamOptions.maxAge = flags.cache
}

return stream(req, related, streamOptions).pipe(res)
}

0 comments on commit 38cc9a3

Please sign in to comment.