Skip to content

Commit 3f8e4ff

Browse files
authored
Correctly handle empty username for Redis/RedisNg AUTH (#170)
Signed-off-by: Reda <reda.bouchaala@printify.com>
1 parent abe6bbb commit 3f8e4ff

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Prometheus/Storage/Redis.php

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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)