Comparing version 1.0.5 to 1.0.6
15
build.js
@@ -58,7 +58,13 @@ const fs = require('fs'); | ||
function send(req, res, file, stats, headers={}) { | ||
let code=200, tmp, opts={} | ||
function send(req, res, file, stats, headers) { | ||
let code=200, tmp, opts={}; | ||
headers = { ...headers }; | ||
for (let key in headers) { | ||
tmp = res.getHeader(key); | ||
if (tmp) headers[key] = tmp; | ||
} | ||
if (tmp = res.getHeader('content-type')) { | ||
headers = { ...headers, 'Content-Type': tmp }; | ||
headers['Content-Type'] = tmp; | ||
} | ||
@@ -77,4 +83,3 @@ | ||
} | ||
if (!tmp) headers = { ...headers }; | ||
headers['Content-Range'] = `bytes ${start}-${end}/${stats.size}`; | ||
@@ -81,0 +86,0 @@ headers['Content-Length'] = (end - start + 1); |
{ | ||
"name": "sirv", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "The optimized & lightweight middleware for serving requests to static assets", | ||
@@ -27,3 +27,3 @@ "repository": "lukeed/sirv", | ||
}, | ||
"gitHead": "45e2dafabb65fc68b7fb3ec21d47bf40a2cbb8d4" | ||
"gitHead": "fab9f18e95fdd752a0919da3fe51bb41f08c1276" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21302
306