Skip to content

Commit e9ba91c

Browse files
committed
Correctly handle empty username for Redis/RedisNg AUTH
Signed-off-by: Reda <[email protected]>
1 parent abe6bbb commit e9ba91c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Prometheus/Storage/Redis.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ private function ensureOpenConnection(): void
198198
$this->connectToServer();
199199
$authParams = [];
200200

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

src/Prometheus/Storage/RedisNg.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ private function ensureOpenConnection(): void
198198
$this->connectToServer();
199199
$authParams = [];
200200

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

0 commit comments

Comments
 (0)