redis / go-redis

Redis Go client
https://redis.uptrace.dev
BSD 2-Clause "Simplified" License
20.06k stars 2.37k forks source link

When the password for a Redis connection string contains an '@' symbol, the connection cannot be recognized #2798

Open ayedaren opened 11 months ago

ayedaren commented 11 months ago

When the password for a Redis connection string contains an '@' symbol, the connection cannot be recognized, for example:

redis://:xxx!@2014@1.1.160.139:6379/10

peczenyj commented 11 months ago

According to RFC 3986, section 3.2.1, it needs to be percent encoded:

userinfo = *( unreserved / pct-encoded / sub-delims / ":" )

So you should try this:

redis://:xxx!%402014@1.1.160.139:6379/10

using %40 instead @

tzq0301 commented 10 months ago

Maybe this help? url.PathEscape