mirror of
https://github.com/spchcap/speech.capital.git
synced 2026-01-13 16:18:06 +00:00
Fix: Use robust JSON helper for header handling
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user