http: Don't listen 1 port beyond port range

This commit is contained in:
Matthew Holt 2019-11-30 17:53:25 -07:00
parent 7c7ef8d40e
commit 44f23a67bb
No known key found for this signature in database
GPG Key ID: 2A349DD577D586A5
1 changed files with 1 additions and 1 deletions

View File

@ -187,7 +187,7 @@ func (app *App) Start() error {
if err != nil {
return fmt.Errorf("%s: parsing listen address '%s': %v", srvName, lnAddr, err)
}
for i := uint(0); i <= listenAddr.PortRangeSize(); i++ {
for i := uint(0); i < listenAddr.PortRangeSize(); i++ {
hostport := listenAddr.JoinHostPort(i)
ln, err := caddy.Listen(listenAddr.Network, hostport)
if err != nil {