Skip to content

Commit

Permalink
Merge pull request #457 from tucksaun/fix/out-of-range-error
Browse files Browse the repository at this point in the history
Revert "Simplify code"
  • Loading branch information
fabpot committed Mar 23, 2024
2 parents 353644a + 0f5a291 commit 877ffa9
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions envs/local.go
Expand Up @@ -259,11 +259,15 @@ func (l *Local) webServer() Envs {
host := fmt.Sprintf("127.0.0.1:%s", port)

if proxyConf, err := proxy.Load(util.GetHomeDir()); err == nil {
host = proxyConf.GetDomains(l.Dir)[0]
if pidFile.Scheme == "http" {
port = "80"
} else {
port = "443"
for _, domain := range proxyConf.GetDomains(l.Dir) {
// we get the first one only
host = domain
if pidFile.Scheme == "http" {
port = "80"
} else {
port = "443"
}
break
}
}

Expand Down

0 comments on commit 877ffa9

Please sign in to comment.