URL decode database name when parsing connection url (#3593)

This commit is contained in:
Benoit Ranque 2024-11-27 17:48:34 -04:00 committed by GitHub
parent a7f2928a1b
commit e3ef8baf23
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -40,7 +40,11 @@ impl PgConnectOptions {
let path = url.path().trim_start_matches('/');
if !path.is_empty() {
options = options.database(path);
options = options.database(
&percent_decode_str(path)
.decode_utf8()
.map_err(Error::config)?,
);
}
for (key, value) in url.query_pairs().into_iter() {