v0.5-rc2: fixed port being overridden to 80 or 443

This commit is contained in:
yusing 2024-09-17 00:30:26 +08:00
parent c0ebd9f8c0
commit 1120991019

View file

@ -39,6 +39,7 @@ func (e *ProxyEntry) SetDefaults() {
if e.Host == "" { if e.Host == "" {
e.Host = "localhost" e.Host = "localhost"
} }
if e.Port == "" {
switch e.Scheme { switch e.Scheme {
case "http": case "http":
e.Port = "80" e.Port = "80"
@ -46,3 +47,4 @@ func (e *ProxyEntry) SetDefaults() {
e.Port = "443" e.Port = "443"
} }
} }
}