mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-20 13:00:24 +08:00
优化代码
This commit is contained in:
@@ -5,22 +5,22 @@ import (
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/shared"
|
||||
)
|
||||
|
||||
// 解析最小长度
|
||||
// DecodeMinLength 解析最小长度
|
||||
func (this *HTTPGzip) DecodeMinLength() (*shared.SizeCapacity, error) {
|
||||
if len(this.MinLength) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
capacity := &shared.SizeCapacity{}
|
||||
err := json.Unmarshal([]byte(this.MinLength), capacity)
|
||||
err := json.Unmarshal(this.MinLength, capacity)
|
||||
return capacity, err
|
||||
}
|
||||
|
||||
// 解析最大长度
|
||||
// DecodeMaxLength 解析最大长度
|
||||
func (this *HTTPGzip) DecodeMaxLength() (*shared.SizeCapacity, error) {
|
||||
if len(this.MaxLength) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
capacity := &shared.SizeCapacity{}
|
||||
err := json.Unmarshal([]byte(this.MaxLength), capacity)
|
||||
err := json.Unmarshal(this.MaxLength, capacity)
|
||||
return capacity, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user