refactor: split playback proxy logic into separate handler files

This commit is contained in:
2026-06-16 00:53:52 +02:00
committed by Milas Holsting
parent 9e25745804
commit 2a04876754
7 changed files with 306 additions and 257 deletions

View File

@@ -0,0 +1,17 @@
package handler
import "net/http"
func copyProxyHeaders(dst http.Header, src http.Header) {
// Skip hop-by-hop headers; see RFC 7230 section 6.1.
// We intentionally preserve multi-value headers by copying the full slice.
for k, v := range src {
switch http.CanonicalHeaderKey(k) {
case "Connection", "Keep-Alive", "Proxy-Authenticate", "Proxy-Authorization", "Te", "Trailer", "Transfer-Encoding", "Upgrade":
continue
}
copied := make([]string, len(v))
copy(copied, v)
dst[k] = copied
}
}