1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Remove redundant applyHeaders method (#469)

Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
Lauri Nevala 2020-07-03 11:22:58 +03:00 committed by GitHub
parent 69778d5dcc
commit c15aa7972c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 14 deletions

View File

@ -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<any>) {
try {
await callback(this.cluster.kubeconfigPath())

View File

@ -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);
});