feat: add vary header helper

This commit is contained in:
2026-07-03 02:54:40 +02:00
parent 372c93ab52
commit 58abaaceb0

View File

@@ -0,0 +1,18 @@
package server
import (
"net/http"
"strings"
)
//nolint:unused
func addVary(header http.Header, value string) {
for _, line := range header.Values("Vary") {
for _, existing := range strings.Split(line, ",") {
if strings.EqualFold(strings.TrimSpace(existing), value) {
return
}
}
}
header.Add("Vary", value)
}