From 363657895ec1e44e6f0ed4314623d424ae672936 Mon Sep 17 00:00:00 2001 From: Denis Carriere Date: Mon, 30 Oct 2023 19:23:01 -0400 Subject: [PATCH] fix cors --- src/fetch/cors.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/fetch/cors.ts b/src/fetch/cors.ts index ec7a9b3..f034260 100644 --- a/src/fetch/cors.ts +++ b/src/fetch/cors.ts @@ -1,9 +1,5 @@ import { BunFile } from "bun"; -export const BadRequest = toText('Bad Request', 400); -export const NotFound = toText('Not Found', 404); -export const InternalServerError = toText("Internal Server Error", 500); - export const CORS_HEADERS = new Headers({ "Access-Control-Allow-Origin": "*", "Access-Control-Allow-Methods": "GET, POST, OPTIONS", @@ -35,3 +31,7 @@ export function toFile(body: BunFile, status = 200, headers = new Headers()) { const fileHeaders = new Headers({"Content-Type": body.type}); return new Response(body, { status, headers: appendHeaders(fileHeaders, headers) }); } + +export const BadRequest = toText('Bad Request', 400); +export const NotFound = toText('Not Found', 404); +export const InternalServerError = toText("Internal Server Error", 500); \ No newline at end of file