fix: header guard

This commit is contained in:
cha0s 2021-04-07 00:03:04 -05:00
parent f6761b10a1
commit 0876ca25a2

View File

@ -68,7 +68,9 @@ export const createHttpServer = async (latus) => {
res.statusCode = proxyRes.statusCode; res.statusCode = proxyRes.statusCode;
if ('text/html; charset=UTF-8' === proxyRes.headers['content-type']) { if ('text/html; charset=UTF-8' === proxyRes.headers['content-type']) {
requestMiddleware(req, res, () => { requestMiddleware(req, res, () => {
if (!res.headersSent) {
res.setHeader('Content-Type', proxyRes.headers['content-type']); res.setHeader('Content-Type', proxyRes.headers['content-type']);
}
proxyRes.pipe(res); proxyRes.pipe(res);
}); });
} }