mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Remove redundant applyHeaders method
Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
parent
47082adecd
commit
1cce5bfe31
@ -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<any>) {
|
||||
try {
|
||||
await callback(this.cluster.kubeconfigPath())
|
||||
|
||||
@ -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);
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user