diff --git a/src/main/context-handler.ts b/src/main/context-handler.ts index 137d45cb0f..a5c12e9ffc 100644 --- a/src/main/context-handler.ts +++ b/src/main/context-handler.ts @@ -172,10 +172,6 @@ export class ContextHandler { return serverPort } - public applyHeaders(req: http.IncomingMessage) { - req.headers["authorization"] = `Bearer ${this.id}` - } - public async withTemporaryKubeconfig(callback: (kubeconfig: string) => Promise) { try { await callback(this.cluster.kubeconfigPath()) diff --git a/src/main/proxy.ts b/src/main/proxy.ts index 4ca2f54539..2fc28a0adc 100644 --- a/src/main/proxy.ts +++ b/src/main/proxy.ts @@ -142,13 +142,6 @@ export class LensProxy { return } const contextHandler = cluster.contextHandler - try { - contextHandler.applyHeaders(req) - } catch (error) { - res.statusCode = 503 - res.end() - return - } contextHandler.ensureServer().then(async () => { const proxyTarget = await this.getProxyTarget(req, contextHandler) if (proxyTarget) { @@ -161,9 +154,6 @@ export class LensProxy { protected async handleWsUpgrade(req: http.IncomingMessage, socket: Socket, head: Buffer) { const wsServer = this.createWsListener(); - const cluster = this.clusterManager.getClusterForRequest(req) - const contextHandler = cluster.contextHandler - contextHandler.applyHeaders(req); wsServer.handleUpgrade(req, socket, head, (con) => { wsServer.emit("connection", con, req); });