From 50ec37f15819a66bb3677079ffd7d3f720cb5f10 Mon Sep 17 00:00:00 2001 From: Jari Kolehmainen Date: Mon, 12 Jul 2021 17:07:54 +0300 Subject: [PATCH] Set res.statusCode before flushing headers (#3353) Signed-off-by: Jari Kolehmainen --- src/main/proxy/lens-proxy.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/proxy/lens-proxy.ts b/src/main/proxy/lens-proxy.ts index 66a00284aa..480a4b047a 100644 --- a/src/main/proxy/lens-proxy.ts +++ b/src/main/proxy/lens-proxy.ts @@ -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(); + } } });