Skip to content

Commit

Permalink
Correctly handle empty username for Redis/RedisNg AUTH
Browse files Browse the repository at this point in the history
Signed-off-by: Reda <reda.bouchaala@printify.com>
  • Loading branch information
breda committed Dec 6, 2024
1 parent abe6bbb commit e9ba91c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Prometheus/Storage/Redis.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ private function ensureOpenConnection(): void
$this->connectToServer();
$authParams = [];

if (isset($this->options['user'])) {
if (isset($this->options['user']) && $this->options['user'] !== '') {
$authParams[] = $this->options['user'];
}

Expand Down
2 changes: 1 addition & 1 deletion src/Prometheus/Storage/RedisNg.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ private function ensureOpenConnection(): void
$this->connectToServer();
$authParams = [];

if (isset($this->options['user'])) {
if (isset($this->options['user']) && $this->options['user'] !== '') {
$authParams[] = $this->options['user'];
}

Expand Down

0 comments on commit e9ba91c

Please sign in to comment.