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 (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));
|
||||
return;
|
||||
} 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));
|
||||
return;
|
||||
}
|
||||
|
|
Reference in a new issue