Skip to content

Commit

Permalink
fix: add decodeuricomponent to parse uri encoded special characters i…
Browse files Browse the repository at this point in the history
…n host, username, password and datbase keys
  • Loading branch information
samarpanB committed Nov 14, 2023
1 parent 1aec4fd commit d2d2515
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/connection_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,11 @@ class ConnectionConfig {
static parseUrl(url) {
const parsedUrl = new URL(url);
const options = {
host: parsedUrl.hostname,
host: decodeURIComponent(parsedUrl.hostname),
port: parseInt(parsedUrl.port, 10),
database: parsedUrl.pathname.slice(1),
user: parsedUrl.username,
password: parsedUrl.password
database: decodeURIComponent(parsedUrl.pathname.slice(1)),
user: decodeURIComponent(parsedUrl.username),
password: decodeURIComponent(parsedUrl.password),
};
parsedUrl.searchParams.forEach((value, key) => {
try {
Expand Down

0 comments on commit d2d2515

Please sign in to comment.