upstream-response-headers.mjs
sha256:65ccb454656ea5acdea0a10e559b78bcde1eb6ff753ecc2911bc99d1c3d7cadd
feat(calendar): enforce agent context tiers in retrieval AP…
Human
minor
⚠ breaking
1 day ago
| 1 | /** |
| 2 | * When the gateway proxies with fetch().text(), the body is already decoded. |
| 3 | * Forwarding upstream Content-Encoding (e.g. br) causes browsers to ERR_CONTENT_DECODING_FAILED. |
| 4 | */ |
| 5 | |
| 6 | const STRIP_FROM_UPSTREAM_DECODED_BODY = new Set([ |
| 7 | 'content-encoding', |
| 8 | 'content-length', |
| 9 | 'transfer-encoding', |
| 10 | 'connection', |
| 11 | 'access-control-allow-origin', |
| 12 | 'access-control-allow-methods', |
| 13 | 'access-control-allow-headers', |
| 14 | 'access-control-allow-credentials', |
| 15 | 'access-control-expose-headers', |
| 16 | 'access-control-max-age', |
| 17 | ]); |
| 18 | |
| 19 | /** |
| 20 | * @param {Iterable<[string, string]>} entries - upstream Response.headers entries |
| 21 | * @returns {[string, string][]} |
| 22 | */ |
| 23 | export function filterUpstreamResponseHeadersForDecodedBody(entries) { |
| 24 | return [...entries].filter(([k]) => !STRIP_FROM_UPSTREAM_DECODED_BODY.has(k.toLowerCase())); |
| 25 | } |
File History
2 commits
sha256:65ccb454656ea5acdea0a10e559b78bcde1eb6ff753ecc2911bc99d1c3d7cadd
feat(calendar): enforce agent context tiers in retrieval AP…
Human
minor
⚠
1 day ago
sha256:9103f98c89257ed2b01c237cea895dabb3e85ea337dccb1161c175e4422355b6
docs: accept Calendar Events v0 spec with Phase 0 security …
Human
1 day ago