Escape postgres password, GH-96
This commit is contained in:
parent
c02d15ec34
commit
3170fb22cb
@ -3,6 +3,7 @@ package connection
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
neturl "net/url"
|
||||
"os"
|
||||
"os/user"
|
||||
"strings"
|
||||
@ -83,7 +84,7 @@ func BuildString(opts command.Options) (string, error) {
|
||||
}
|
||||
|
||||
if opts.Pass != "" {
|
||||
url += fmt.Sprintf(":%s", opts.Pass)
|
||||
url += fmt.Sprintf(":%s", neturl.QueryEscape(opts.Pass))
|
||||
}
|
||||
|
||||
url += fmt.Sprintf("@%s:%d", opts.Host, opts.Port)
|
||||
|
File diff suppressed because one or more lines are too long
@ -452,7 +452,7 @@ function getConnectionString() {
|
||||
var host = $("#pg_host").val();
|
||||
var port = $("#pg_port").val();
|
||||
var user = $("#pg_user").val();
|
||||
var pass = $("#pg_password").val();
|
||||
var pass = encodeURIComponent($("#pg_password").val());
|
||||
var db = $("#pg_db").val();
|
||||
|
||||
if (port.length == 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user