Allowing Leading and Trailing spaces in connection (#3433)

This commit is contained in:
Ishpreet Singh 2017-11-08 11:43:18 +05:30 committed by Maxime Beauchemin
parent dee47864c4
commit 0280bc52e0
2 changed files with 2 additions and 2 deletions

View File

@ -596,7 +596,7 @@ class Database(Model, AuditMixinNullable):
return url_copy
def set_sqlalchemy_uri(self, uri):
conn = sqla.engine.url.make_url(uri)
conn = sqla.engine.url.make_url(uri.strip())
if conn.password != PASSWORD_MASK and not self.custom_password_store:
# do not over-write the password with the password mask
self.password = conn.password

View File

@ -18,7 +18,7 @@
var data = {};
try{
data = JSON.stringify({
uri: $("#sqlalchemy_uri").val(),
uri: $.trim($("#sqlalchemy_uri").val()),
name: $('#database_name').val(),
impersonate_user: $('#impersonate_user').is(':checked'),
extras: JSON.parse($("#extra").val()),