set res.statusCode before flushing headers

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen committed 2021-07-12 13:42:33 +03:00
1 parent 52ab699426
commit f970fa1123
1 file changed
+4 -1
+4 -1
View File
@@ -168,7 +168,10 @@ export class LensProxy extends Singleton {
if (!res.headersSent && req.url) {
const url = new URL(req.url, "http://localhost");
if (url.searchParams.has("watch")) res.flushHeaders();
if (url.searchParams.has("watch")) {
res.statusCode = proxyRes.statusCode;
res.flushHeaders();
}
}
});