From 935c297e71c435f9675a0f69822cbfc9d8562c50 Mon Sep 17 00:00:00 2001 From: multipleof4 Date: Thu, 2 Oct 2025 11:54:20 -0700 Subject: [PATCH] Fix: Use robust JSON helper for header handling --- functions/api/auth-params.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/functions/api/auth-params.js b/functions/api/auth-params.js index 39fdde5..318a064 100644 --- a/functions/api/auth-params.js +++ b/functions/api/auth-params.js @@ -1,4 +1,8 @@ -const json = (d, o) => new Response(JSON.stringify(d), { ...o, headers: { 'Content-Type': 'application/json' } }); +const json = (d, o = {}) => { + const h = new Headers(o.headers); + h.set('Content-Type', 'application/json'); + return new Response(JSON.stringify(d), { ...o, headers: h }); +}; export async function onRequestGet({ request, env }) { try {