mirror of
https://github.com/sosedoff/pgweb.git
synced 2024-12-14 19:21:46 +03:00
Add extra note
This commit is contained in:
parent
d48172986e
commit
c32d68809b
@ -59,6 +59,8 @@ func ParseOptions(args []string) (Options, error) {
|
|||||||
opts.Prefix = os.Getenv("URL_PREFIX")
|
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 (opts.Host == "localhost" || opts.Host == "127.0.0.1") && opts.User == "" {
|
||||||
if username := GetCurrentUser(); username != "" {
|
if username := GetCurrentUser(); username != "" {
|
||||||
opts.User = username
|
opts.User = username
|
||||||
|
Loading…
Reference in New Issue
Block a user