Skip to content

Commit

Permalink
URL decode database name when parsing connection url
Browse files Browse the repository at this point in the history
  • Loading branch information
BenoitRanque committed Nov 5, 2024
1 parent 82d332f commit eb9e635
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sqlx-postgres/src/options/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit eb9e635

Please sign in to comment.