Skip to content

Commit

Permalink
fix(sirv): respect existing Content-Type header;
Browse files Browse the repository at this point in the history
- Closes #38
- Closes #39
  • Loading branch information
lukeed committed Sep 28, 2019
1 parent fd55eca commit 5ef168f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/sirv/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ function list(dir, fn, pre='') {
}

function send(req, res, file, stats, headers={}) {
let code=200, opts={};
let code=200, tmp, opts={}

if (tmp = res.getHeader('content-type')) {
headers['Content-Type'] = tmp;
}

if (req.headers.range) {
code = 206;
Expand Down

0 comments on commit 5ef168f

Please sign in to comment.