Skip to content

Commit

Permalink
encode postgres account name to work with azure
Browse files Browse the repository at this point in the history
Signed-off-by: pmccabensds <[email protected]>
  • Loading branch information
pmccabensds committed May 25, 2021
1 parent e80e709 commit 5091bbe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions experimental/plugins/postgres_storage/src/postgres_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@ impl PostgresStorageType {
let mut url_base = "postgresql://".to_owned();

match credentials.admin_account {
Some(ref account) => url_base.push_str(&account[..]),
Some(ref account) =>url_base.push_str(&utf8_percent_encode(&account[..], &NON_ALPHANUMERIC).to_string()),
None => ()
}
url_base.push_str(":");
Expand All @@ -1052,7 +1052,7 @@ impl PostgresStorageType {

fn _base_postgres_url(config: &PostgresConfig, credentials: &PostgresCredentials) -> String {
let mut url_base = "postgresql://".to_owned();
url_base.push_str(&credentials.account[..]);
url_base.push_str(&utf8_percent_encode(&credentials.account[..], &NON_ALPHANUMERIC).to_string());
url_base.push_str(":");
url_base.push_str(&utf8_percent_encode(&credentials.password[..], &NON_ALPHANUMERIC).to_string());
url_base.push_str("@");
Expand Down

0 comments on commit 5091bbe

Please sign in to comment.