diff --git a/src/main/context-handler.ts b/src/main/context-handler.ts index 9f2977dfc4..e1e4add2ea 100644 --- a/src/main/context-handler.ts +++ b/src/main/context-handler.ts @@ -171,10 +171,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 56febb9273..bc4de428b1 100644 --- a/src/main/proxy.ts +++ b/src/main/proxy.ts @@ -155,13 +155,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) { @@ -174,9 +167,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); });