mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 20:57:19 +08:00
fix: Alt-Svc头删除不正确
This commit is contained in:
@@ -439,11 +439,13 @@ func (p *Parser) SetAltSvc(altSvc string) error {
|
||||
for _, dir := range old {
|
||||
if slices.Contains(dir.GetParameters(), "Alt-Svc") {
|
||||
foundFlag = true
|
||||
directives = append(directives, &config.Directive{
|
||||
Name: dir.GetName(),
|
||||
Parameters: []string{"Alt-Svc", altSvc},
|
||||
Comment: dir.GetComment(),
|
||||
})
|
||||
if altSvc != "" { // 为空表示要删除
|
||||
directives = append(directives, &config.Directive{
|
||||
Name: dir.GetName(),
|
||||
Parameters: []string{"Alt-Svc", altSvc},
|
||||
Comment: dir.GetComment(),
|
||||
})
|
||||
}
|
||||
} else {
|
||||
directives = append(directives, &config.Directive{
|
||||
Name: dir.GetName(),
|
||||
|
||||
Reference in New Issue
Block a user