mirror of
https://github.com/sosedoff/pgweb.git
synced 2024-12-15 03:36:33 +03:00
Append ssl mode to url if ssl flag is set and not defined in the url
This commit is contained in:
parent
e032315195
commit
61ecc9e9a1
9
main.go
9
main.go
@ -8,6 +8,7 @@ import (
|
||||
"os"
|
||||
"os/exec"
|
||||
"os/signal"
|
||||
"strings"
|
||||
)
|
||||
|
||||
const VERSION = "0.3.1"
|
||||
@ -38,7 +39,13 @@ func exitWithMessage(message string) {
|
||||
|
||||
func getConnectionString() string {
|
||||
if options.Url != "" {
|
||||
return options.Url
|
||||
url := options.Url
|
||||
|
||||
if options.Ssl != "" && !strings.Contains(url, "sslmode") {
|
||||
url += fmt.Sprintf("?sslmode=%s", options.Ssl)
|
||||
}
|
||||
|
||||
return url
|
||||
}
|
||||
|
||||
str := fmt.Sprintf(
|
||||
|
Loading…
Reference in New Issue
Block a user