Add extra note

This commit is contained in:
Dan Sosedoff 2019-01-28 14:22:05 -06:00
parent d48172986e
commit c32d68809b

View File

@ -59,6 +59,8 @@ func ParseOptions(args []string) (Options, error) {
opts.Prefix = os.Getenv("URL_PREFIX")
}
// Handle edge case where pgweb is started with a default host `localhost` and no user.
// When user is not set the `lib/pq` connection will fail and cause pgweb's termination.
if (opts.Host == "localhost" || opts.Host == "127.0.0.1") && opts.User == "" {
if username := GetCurrentUser(); username != "" {
opts.User = username