mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2025-11-06 06:40:25 +08:00
80/443端口的源站自动修正HTTP和HTTPS协议,防止有些小白用户不知道HTTP和HTTPS的区别
This commit is contained in:
@@ -27,6 +27,14 @@ type NetworkAddressConfig struct {
|
|||||||
func (this *NetworkAddressConfig) Init() error {
|
func (this *NetworkAddressConfig) Init() error {
|
||||||
this.hostHasVariables = configutils.HasVariables(this.Host)
|
this.hostHasVariables = configutils.HasVariables(this.Host)
|
||||||
|
|
||||||
|
// 特殊端口自动修复,防止有些小白用户不了解HTTP和HTTPS的区别而选择了错误的协议
|
||||||
|
if this.PortRange == "80" && this.Protocol == ProtocolHTTPS {
|
||||||
|
this.Protocol = ProtocolHTTP
|
||||||
|
}
|
||||||
|
if this.PortRange == "443" && this.Protocol == ProtocolHTTP {
|
||||||
|
this.Protocol = ProtocolHTTPS
|
||||||
|
}
|
||||||
|
|
||||||
// 8080
|
// 8080
|
||||||
if regexpSinglePort.MatchString(this.PortRange) {
|
if regexpSinglePort.MatchString(this.PortRange) {
|
||||||
this.MinPort = types.Int(this.PortRange)
|
this.MinPort = types.Int(this.PortRange)
|
||||||
|
|||||||
Reference in New Issue
Block a user