diff --git a/lib/utils/index.ts b/lib/utils/index.ts index 3f9cd434..e156b4dd 100644 --- a/lib/utils/index.ts +++ b/lib/utils/index.ts @@ -258,9 +258,6 @@ export function parseURL(url) { const result: any = {}; if (parsed.auth) { const parsedAuth = parsed.auth.split(":"); - if (parsedAuth[0]) { - result.username = parsedAuth[0]; - } result.password = parsedAuth[1]; } if (parsed.pathname) { diff --git a/test/functional/auth.ts b/test/functional/auth.ts index 7438831e..e9fa22cb 100644 --- a/test/functional/auth.ts +++ b/test/functional/auth.ts @@ -170,23 +170,6 @@ describe("auth", function () { redis = new Redis({ port: 17379, username, password }); }); - it("should handle auth with Redis URL string with username and password (Redis >=6) (redis://foo:bar@baz.com/) correctly", function (done) { - let username = "user"; - let password = "pass"; - let redis; - new MockServer(17379, function (argv) { - if ( - argv[0] === "auth" && - argv[1] === username && - argv[2] === password - ) { - redis.disconnect(); - done(); - } - }); - redis = new Redis(`redis://user:pass@localhost:17379/`); - }); - it('should not emit "error" when the Redis >=6 server doesn\'t need auth', function (done) { new MockServer(17379, function (argv) { if (argv[0] === "auth" && argv[1] === "pass") { diff --git a/test/unit/utils.ts b/test/unit/utils.ts index fda1ba4d..c8acbad0 100644 --- a/test/unit/utils.ts +++ b/test/unit/utils.ts @@ -193,7 +193,6 @@ describe("utils", function () { port: "6380", db: "4", password: "pass", - username: "user", key: "value", }); expect(utils.parseURL("redis://127.0.0.1/")).to.eql({ @@ -206,7 +205,6 @@ describe("utils", function () { port: "6380", db: "4", password: "pass", - username: "user", key: "value", }); });