添加Header的时候自动去除Header后多余的冒号

This commit is contained in:
GoEdgeLab
2022-09-23 19:00:51 +08:00
parent 2c0a13698f
commit 1bc69fe538
2 changed files with 6 additions and 0 deletions

View File

@@ -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, "设置请求HeaderHeaderPolicyId:%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名称")

View File

@@ -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, "修改设置请求HeaderHeaderPolicyId:%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名称")