From 74b9f67b1aa2991184f0a1d2c93d23c1ccd2f87e Mon Sep 17 00:00:00 2001 From: multipleof4 Date: Thu, 2 Oct 2025 11:54:22 -0700 Subject: [PATCH] Fix: Correctly set multiple cookies using Headers object --- functions/api/login.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/functions/api/login.js b/functions/api/login.js index 27384b1..0ec89bd 100644 --- a/functions/api/login.js +++ b/functions/api/login.js @@ -1,4 +1,8 @@ -const json=(d,o)=>new Response(JSON.stringify(d),{...o,headers:{'Content-Type':'application/json',...(o?.headers||{})}}); +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 }); +}; const tsEq=(a,b)=>{let d=a.length^b.length;for(let i=0;i