From 8cf4087e569c3b57a2a4b689c5944c35247edb1c Mon Sep 17 00:00:00 2001 From: srosset81 Date: Thu, 1 Aug 2024 15:19:13 +0200 Subject: [PATCH] Add HEAD methods --- src/pages/.well-known/context.json.ts | 14 +++++++++++++- src/pages/context.json.ts | 14 +++++++++++++- src/pages/data/[container]/[resource].ts | 15 ++++++++++++++- src/pages/data/[container]/index.ts | 15 ++++++++++++++- src/pages/data/trusted-apps.ts | 15 ++++++++++++++- 5 files changed, 68 insertions(+), 5 deletions(-) diff --git a/src/pages/.well-known/context.json.ts b/src/pages/.well-known/context.json.ts index 64c92d3..1ea258a 100644 --- a/src/pages/.well-known/context.json.ts +++ b/src/pages/.well-known/context.json.ts @@ -179,4 +179,16 @@ export const GET: APIRoute = async () => { } } ); -}; \ No newline at end of file +}; + +export const HEAD: APIRoute = async () => { + return new Response(undefined, + { + status: 200, + headers: { + "Content-Type": "application/ld+json", + "Access-Control-Allow-Origin": "*" + } + } + ); +}; diff --git a/src/pages/context.json.ts b/src/pages/context.json.ts index bc9523d..54ef6fe 100644 --- a/src/pages/context.json.ts +++ b/src/pages/context.json.ts @@ -1053,4 +1053,16 @@ export const GET: APIRoute = async () => { } } ); -}; \ No newline at end of file +}; + +export const HEAD: APIRoute = async () => { + return new Response(undefined, + { + status: 200, + headers: { + "Content-Type": "application/ld+json", + "Access-Control-Allow-Origin": "*" + } + } + ); +}; diff --git a/src/pages/data/[container]/[resource].ts b/src/pages/data/[container]/[resource].ts index ef0820d..cc89f89 100644 --- a/src/pages/data/[container]/[resource].ts +++ b/src/pages/data/[container]/[resource].ts @@ -10,8 +10,21 @@ export const GET: APIRoute = async ({ request, params }) => { { status: 200, headers: { - "Content-Type": "application/ld+json" + "Content-Type": "application/ld+json", + "Access-Control-Allow-Origin": "*" } } ); } + +export const HEAD: APIRoute = async () => { + return new Response(undefined, + { + status: 200, + headers: { + "Content-Type": "application/ld+json", + "Access-Control-Allow-Origin": "*" + } + } + ); +}; diff --git a/src/pages/data/[container]/index.ts b/src/pages/data/[container]/index.ts index 08399e1..0e4e707 100644 --- a/src/pages/data/[container]/index.ts +++ b/src/pages/data/[container]/index.ts @@ -10,8 +10,21 @@ export const GET: APIRoute = async ({ request, params }) => { { status: 200, headers: { - "Content-Type": "application/ld+json" + "Content-Type": "application/ld+json", + "Access-Control-Allow-Origin": "*" } } ); } + +export const HEAD: APIRoute = async () => { + return new Response(undefined, + { + status: 200, + headers: { + "Content-Type": "application/ld+json", + "Access-Control-Allow-Origin": "*" + } + } + ); +}; diff --git a/src/pages/data/trusted-apps.ts b/src/pages/data/trusted-apps.ts index bf2ea96..abb35b9 100644 --- a/src/pages/data/trusted-apps.ts +++ b/src/pages/data/trusted-apps.ts @@ -27,7 +27,20 @@ export const GET: APIRoute = async ({ request }) => { { status: 200, headers: { - "Content-Type": "application/ld+json" + "Content-Type": "application/ld+json", + "Access-Control-Allow-Origin": "*" + } + } + ); +}; + +export const HEAD: APIRoute = async () => { + return new Response(undefined, + { + status: 200, + headers: { + "Content-Type": "application/ld+json", + "Access-Control-Allow-Origin": "*" } } );