Skip to content

Commit

Permalink
Escape postgres password, GH-96
Browse files Browse the repository at this point in the history
  • Loading branch information
sosedoff committed Aug 16, 2015
1 parent c02d15e commit 3170fb2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion pkg/connection/connection_string.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package connection
import (
"errors"
"fmt"
neturl "net/url"
"os"
"os/user"
"strings"
Expand Down Expand Up @@ -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)
Expand Down
Loading

0 comments on commit 3170fb2

Please sign in to comment.