优化代码

This commit is contained in:
GoEdgeLab
2023-02-03 15:34:11 +08:00
parent ee70a673fe
commit 2e5568dd39
2 changed files with 4 additions and 4 deletions

View File

@@ -240,10 +240,10 @@ func (this *HTTPHeaderDAO) ComposeHeaderConfig(tx *dbs.Tx, headerId int64) (*sha
config.Name = header.Name
config.Value = header.Value
config.DisableRedirect = header.DisableRedirect == 1
config.ShouldAppend = header.ShouldAppend == 1
config.ShouldAppend = header.ShouldAppend
// replace
config.ShouldReplace = header.ShouldReplace == 1
config.ShouldReplace = header.ShouldReplace
if IsNotNull(header.ReplaceValues) {
var values = []*shared.HTTPHeaderReplaceValue{}
err = json.Unmarshal(header.ReplaceValues, &values)

View File

@@ -14,8 +14,8 @@ type HTTPHeader struct {
Order uint32 `field:"order"` // 排序
Status dbs.JSON `field:"status"` // 状态码设置
DisableRedirect uint8 `field:"disableRedirect"` // 是否不支持跳转
ShouldAppend uint8 `field:"shouldAppend"` // 是否为附加
ShouldReplace uint8 `field:"shouldReplace"` // 是否替换变量
ShouldAppend bool `field:"shouldAppend"` // 是否为附加
ShouldReplace bool `field:"shouldReplace"` // 是否替换变量
ReplaceValues dbs.JSON `field:"replaceValues"` // 替换的值
Methods dbs.JSON `field:"methods"` // 支持的方法
Domains dbs.JSON `field:"domains"` // 支持的域名