Skip to content

Commit 0eb542d

Browse files
authored
fix: only prepend scheme to host when necessary (#34017)
In cases where $options['scheme'] is set, but $options['host'] already has the scheme prepended, the resulting host will be scheme://scheme://host
1 parent 134f1dc commit 0eb542d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Illuminate/Redis/Connectors/PhpRedisConnector.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Illuminate\Redis\Connections\PhpRedisConnection;
88
use Illuminate\Support\Arr;
99
use Illuminate\Support\Facades\Redis as RedisFacade;
10+
use Illuminate\Support\Str;
1011
use LogicException;
1112
use Redis;
1213
use RedisCluster;
@@ -175,7 +176,7 @@ protected function createRedisClusterInstance(array $servers, array $options)
175176
protected function formatHost(array $options)
176177
{
177178
if (isset($options['scheme'])) {
178-
return "{$options['scheme']}://{$options['host']}";
179+
return Str::start($options['host'], "{$options['scheme']}://");
179180
}
180181

181182
return $options['host'];

0 commit comments

Comments
 (0)