Skip to content

Commit

Permalink
Serve files without a mime type as text (like dotfiles)
Browse files Browse the repository at this point in the history
  • Loading branch information
leo committed Feb 4, 2017
1 parent 75a8d6a commit 5ffb291
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ module.exports = async (req, res, flags, current, ignoredFiles) => {
return stream(req, indexPath).pipe(res)
}

// Serve files without a mime type as text
stream.mime.default_type = 'text/plain'

return stream(req, related, {
dotfiles: 'allow'
}).pipe(res)
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"complexity": 0,
"import/no-unassigned-import": 0,
"unicorn/no-process-exit": 0,
"max-params": 0
"max-params": 0,
"camelcase": 0
}
},
"keywords": [
Expand Down

0 comments on commit 5ffb291

Please sign in to comment.