add response content-length
This commit is contained in:
parent
b0ff68e660
commit
b1b100ccf4
@ -18,6 +18,7 @@ export async function createResServer() {
|
||||
const resourcePath = path.join(dirPath, `${fileRealName}`);
|
||||
if (fs.existsSync(resourcePath)) {
|
||||
const data = fs.readFileSync(resourcePath);
|
||||
response.setHeader("content-length", data.length);
|
||||
response.write(data);
|
||||
response.end();
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user