fix: read port from environment variable

This commit is contained in:
yichya QC 2022-04-26 20:28:25 +08:00 committed by yuhan6665
parent 5e18ae68b7
commit 2f86c7c795

View file

@ -207,7 +207,7 @@ func (list *PortList) UnmarshalJSON(data []byte) error {
for _, rangeStr := range rangelist {
trimmed := strings.TrimSpace(rangeStr)
if len(trimmed) > 0 {
if strings.Contains(trimmed, "-") {
if strings.Contains(trimmed, "-") || strings.Contains(trimmed, "env:") {
from, to, err := parseStringPort(trimmed)
if err != nil {
return newError("invalid port range: ", trimmed).Base(err)