Set res.statusCode before flushing headers (#3353)

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen authored and GitHub committed 2021-07-12 10:07:54 -04:00
1 parent f86360d641
commit 50ec37f158
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();
}
}
});