mirror of
				https://github.com/TeaOSLab/EdgeAdmin.git
				synced 2025-11-04 05:00:25 +08:00 
			
		
		
		
	添加Header的时候自动去除Header后多余的冒号
This commit is contained in:
		@@ -7,6 +7,7 @@ import (
 | 
			
		||||
	"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
 | 
			
		||||
	"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/shared"
 | 
			
		||||
	"github.com/iwind/TeaGo/actions"
 | 
			
		||||
	"strings"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
type CreateSetPopupAction struct {
 | 
			
		||||
@@ -45,6 +46,8 @@ func (this *CreateSetPopupAction) RunPost(params struct {
 | 
			
		||||
	// 日志
 | 
			
		||||
	defer this.CreateLog(oplogs.LevelInfo, "设置请求Header,HeaderPolicyId:%d, Name:%s, Value:%s", params.HeaderPolicyId, params.Name, params.Value)
 | 
			
		||||
 | 
			
		||||
	params.Name = strings.TrimSuffix(params.Name, ":")
 | 
			
		||||
 | 
			
		||||
	params.Must.
 | 
			
		||||
		Field("name", params.Name).
 | 
			
		||||
		Require("请输入Header名称")
 | 
			
		||||
 
 | 
			
		||||
@@ -7,6 +7,7 @@ import (
 | 
			
		||||
	"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
 | 
			
		||||
	"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/shared"
 | 
			
		||||
	"github.com/iwind/TeaGo/actions"
 | 
			
		||||
	"strings"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
type UpdateSetPopupAction struct {
 | 
			
		||||
@@ -60,6 +61,8 @@ func (this *UpdateSetPopupAction) RunPost(params struct {
 | 
			
		||||
	// 日志
 | 
			
		||||
	defer this.CreateLog(oplogs.LevelInfo, "修改设置请求Header,HeaderPolicyId:%d, Name:%s, Value:%s", params.HeaderId, params.Name, params.Value)
 | 
			
		||||
 | 
			
		||||
	params.Name = strings.TrimSuffix(params.Name, ":")
 | 
			
		||||
 | 
			
		||||
	params.Must.
 | 
			
		||||
		Field("name", params.Name).
 | 
			
		||||
		Require("请输入Header名称")
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user