[反向代理]增加请求主机名类型选择

This commit is contained in:
GoEdgeLab
2020-11-30 22:28:47 +08:00
parent 3dc78e6f37
commit 83dba94235
3 changed files with 40 additions and 30 deletions

View File

@@ -99,6 +99,7 @@ func (this *ReverseProxyDAO) ComposeReverseProxyConfig(reverseProxyId int64) (*s
config := &serverconfigs.ReverseProxyConfig{}
config.Id = int64(reverseProxy.Id)
config.IsOn = reverseProxy.IsOn == 1
config.RequestHostType = types.Int8(reverseProxy.RequestHostType)
config.RequestHost = reverseProxy.RequestHost
config.RequestURI = reverseProxy.RequestURI
config.StripPrefix = reverseProxy.StripPrefix
@@ -223,13 +224,19 @@ func (this *ReverseProxyDAO) UpdateReverseProxyBackupOrigins(reverseProxyId int6
}
// 修改是否启用
func (this *ReverseProxyDAO) UpdateReverseProxy(reverseProxyId int64, requestHost string, requestURI string, stripPrefix string, autoFlush bool) error {
func (this *ReverseProxyDAO) UpdateReverseProxy(reverseProxyId int64, requestHostType int8, requestHost string, requestURI string, stripPrefix string, autoFlush bool) error {
if reverseProxyId <= 0 {
return errors.New("invalid reverseProxyId")
}
op := NewReverseProxyOperator()
op.Id = reverseProxyId
if requestHostType < 0 {
requestHostType = 0
}
op.RequestHostType = requestHostType
op.RequestHost = requestHost
op.RequestURI = requestURI
op.StripPrefix = stripPrefix