forked from svrjs/svrjs
Fix bug in partial content serving functionality
This commit is contained in:
parent
036091a0c6
commit
7fa6a3dfb3
1 changed files with 2 additions and 2 deletions
4
svr.js
4
svr.js
|
@ -3693,11 +3693,11 @@ if (!cluster.isPrimary) {
|
||||||
|
|
||||||
if (req.method != "HEAD") {
|
if (req.method != "HEAD") {
|
||||||
if (ext == "html" && begin < head.length && (end - begin) < head.length) {
|
if (ext == "html" && begin < head.length && (end - begin) < head.length) {
|
||||||
res.writeHead(206, http.STATUS_CODES[206], hdhds);
|
res.writeHead(206, http.STATUS_CODES[206], rhd);
|
||||||
res.end(head.substring(begin, end + 1));
|
res.end(head.substring(begin, end + 1));
|
||||||
return;
|
return;
|
||||||
} else if (ext == "html" && begin >= head.length + filelen){
|
} else if (ext == "html" && begin >= head.length + filelen){
|
||||||
res.writeHead(206, http.STATUS_CODES[206], hdhds);
|
res.writeHead(206, http.STATUS_CODES[206], rhd);
|
||||||
res.end(foot.substring(begin - head.length - filelen, end - head.length - filelen + 1));
|
res.end(foot.substring(begin - head.length - filelen, end - head.length - filelen + 1));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue