fix: 解决伪静态开启报错的问题 (#4591)

pull/4599/head
zhengkunwang 2024-04-19 15:20:08 +08:00 committed by GitHub
parent a4ee16cf1f
commit dad8bac715
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -1954,7 +1954,7 @@ func (w WebsiteService) UpdateAntiLeech(req request.NginxAntiLeechUpdate) (err e
Parameters: []string{"off"}, Parameters: []string{"off"},
}) })
validDir := &components.Directive{ validDir := &components.Directive{
Name: "valid_referrers", Name: "valid_referers",
Parameters: []string{}, Parameters: []string{},
} }
if req.NoneRef { if req.NoneRef {
@ -2023,7 +2023,7 @@ func (w WebsiteService) GetAntiLeech(id uint) (*response.NginxAntiLeechRes, erro
} }
lDirectives := location.GetBlock().GetDirectives() lDirectives := location.GetBlock().GetDirectives()
for _, lDir := range lDirectives { for _, lDir := range lDirectives {
if lDir.GetName() == "valid_referrers" { if lDir.GetName() == "valid_referers" {
res.Enable = true res.Enable = true
params := lDir.GetParameters() params := lDir.GetParameters()
for _, param := range params { for _, param := range params {