2
0
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:
耗子
2024-10-26 04:59:28 +08:00
parent f7c586e05b
commit 145387b3df

View File

@@ -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(),