mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Inject Host header to k8s client requests (#887)
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
1 parent
ec4d859ef7
commit
c2afd026cc
6 files changed
+118
-32
No files matched your search
@@ -44,7 +44,7 @@ export class ClusterManager {
|
||||
// lens-server is connecting to 127.0.0.1:<port>/<uid>
|
||||
if (req.headers.host.startsWith("127.0.0.1")) {
|
||||
const clusterId = req.url.split("/")[1]
|
||||
const cluster = clusterStore.getById(clusterId)
|
||||
cluster = clusterStore.getById(clusterId)
|
||||
if (cluster) {
|
||||
// we need to swap path prefix so that request is proxied to kube api
|
||||
req.url = req.url.replace(`/${clusterId}`, apiKubePrefix)
|
||||
|
||||
Reference in new issue
Block a user