Skip to content

Commit

Permalink
fix(sirv): a request with range headers appends Content-Length, Conte…
Browse files Browse the repository at this point in the history
…nt-Range and Accept-Ranges for all subsequent requests. Fixes lukeed#55
  • Loading branch information
imtiazmangerah committed Jul 31, 2020
1 parent f8ea6a8 commit 296843b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/sirv/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,11 @@ function is404(req, res) {
return (res.statusCode=404,res.end());
}

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

let headers = Object.assign({}, baseHeaders);

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

0 comments on commit 296843b

Please sign in to comment.