(h: unknown)
| 37 | } |
| 38 | |
| 39 | function sanitizeHeaders(h: unknown): Record<string, string> { |
| 40 | const out: Record<string, string> = {}; |
| 41 | if (!h || typeof h !== "object") return out; |
| 42 | for (const [k, v] of Object.entries(h as Record<string, unknown>)) { |
| 43 | if (!k) continue; |
| 44 | if (STRIP_HEADERS.has(k.toLowerCase())) continue; |
| 45 | out[k] = String(v ?? ""); |
| 46 | } |
| 47 | return out; |
| 48 | } |
| 49 | |
| 50 | Deno.serve(async (req: Request): Promise<Response> => { |
| 51 | try { |