fix: header guard
This commit is contained in:
parent
f6761b10a1
commit
0876ca25a2
|
@ -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);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user