From df18f5a6253a2c74542610d868d14c4a401580cd Mon Sep 17 00:00:00 2001 From: Alex Renoki Date: Tue, 3 Aug 2021 14:09:42 +0300 Subject: [PATCH] Added startsWith() check --- src/KubernetesCluster.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/KubernetesCluster.php b/src/KubernetesCluster.php index 1d048734..1c5cb707 100644 --- a/src/KubernetesCluster.php +++ b/src/KubernetesCluster.php @@ -298,7 +298,9 @@ protected function makeWsRequest(string $path, Closure $callback = null, array $ ]; foreach ($replaces as $search => $replace) { - $url = Str::replaceFirst($search, $replace, $url); + if (Str::startsWith($url, $search)) { + $url = Str::replaceFirst($search, $replace, $url); + } } [$loop, $ws] = $this->getWsClient($url);