section 16: Phase 16: Documentation, container ports and full repository checks

This commit is contained in:
Chris Scott committed 2026-10-03 04:07:44 -04:00
1 parent 81a9f0c8ef
commit a383e57bc5
55 files changed
+4095 -59

No files matched your search

+40
View File
@@ -0,0 +1,40 @@
export const HOP_BY_HOP_HEADERS = new Set([
'connection',
'keep-alive',
'proxy-authenticate',
'proxy-authorization',
'te',
'trailers',
'upgrade',
'transfer-encoding',
'content-length',
'content-encoding',
'host',
'authorization',
])
export function filterProxyHeaders(
headers: Headers,
extraExcluded: ReadonlySet<string> = new Set(),
): Record<string, string> {
const result: Record<string, string> = {}
headers.forEach((value, key) => {
const lowerKey = key.toLowerCase()
if (HOP_BY_HOP_HEADERS.has(lowerKey) || extraExcluded.has(lowerKey)) return
result[key] = value
})
return result
}
export function buildProxyResponseHeaders(
source: Headers,
extraExcluded: ReadonlySet<string> = new Set(),
): Headers {
const excluded = new Set(extraExcluded)
excluded.add('set-cookie')
const headers = new Headers(filterProxyHeaders(source, excluded))
for (const cookie of source.getSetCookie()) {
headers.append('set-cookie', cookie)
}
return headers
}