Skip to content

Conversation

ryzr
Copy link
Contributor

@ryzr ryzr commented Aug 26, 2020

Description

Since #33871 was released in v7.26.0, there are cases where connections via PhpRedisConnector are broken.

In cases where users may be using a different connector between development/staging/prod, or from blindly copy-pasting config from StackOverflow, the following configuration may be possible:

REDIS_HOST=tls://myproductionredis.cache.amazonaws.com
'default' => [
    'scheme'   => 'tls',
    'host'       => env('REDIS_HOST', '127.0.0.1'),
    'password'   => env('REDIS_PASSWORD', null),
    'port'       => env('REDIS_PORT', 6379),
    'database'   => env('REDIS_DB', 0),
],

The resulting scheme will be tls://tls://myproductionredis.cache.amazonaws.com

Proposed changes

My change uses the Str::start helper to only add the scheme if the host does not start with it already

In cases where $options['scheme'] is set, but $options['host'] already has the scheme prepended, the resulting host will be scheme://scheme://host
@GrahamCampbell
Copy link
Collaborator

Thanks. Please send this to 6.x.

@ryzr ryzr changed the title Only prepend scheme to PhpRedis host when necessary [7.x] Only prepend scheme to PhpRedis host when necessary Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants