Skip to content

Commit

Permalink
fix: only prepend scheme to host when necessary (#34017)
Browse files Browse the repository at this point in the history
In cases where $options['scheme'] is set, but $options['host'] already has the scheme prepended, the resulting host will be scheme://scheme://host
  • Loading branch information
ryzr committed Aug 26, 2020
1 parent 134f1dc commit 0eb542d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Illuminate/Redis/Connectors/PhpRedisConnector.php
Expand Up @@ -7,6 +7,7 @@
use Illuminate\Redis\Connections\PhpRedisConnection;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Redis as RedisFacade;
use Illuminate\Support\Str;
use LogicException;
use Redis;
use RedisCluster;
Expand Down Expand Up @@ -175,7 +176,7 @@ protected function createRedisClusterInstance(array $servers, array $options)
protected function formatHost(array $options)
{
if (isset($options['scheme'])) {
return "{$options['scheme']}://{$options['host']}";
return Str::start($options['host'], "{$options['scheme']}://");
}

return $options['host'];
Expand Down

0 comments on commit 0eb542d

Please sign in to comment.