MCPcopy
hub / github.com/pingdotgg/uploadthing / cors

Function cors

examples/backend-adapters/server/src/cf-worker.ts:12–18  ·  view source on GitHub ↗
(res?: Response)

Source from the content-addressed store, hash-verified

10}
11
12const cors = (res?: Response) => {
13 if (!res) res = new Response(null, { status: 204 });
14 res.headers.set("Access-Control-Allow-Origin", "*");
15 res.headers.set("Access-Control-Allow-Methods", "GET, POST");
16 res.headers.set("Access-Control-Allow-Headers", "*");
17 return res;
18};
19
20const handler = async (request: Request, env: Env, ctx: ExecutionContext) => {
21 const handler = createRouteHandler({

Callers 5

handlerFunction · 0.85
fetchFunction · 0.85
hono.tsFile · 0.85
elysia.tsFile · 0.85
express.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected