From 794a95db387e4bafbe2a2e9ee6d7d3ee6ae1fab0 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Tue, 10 Oct 2023 22:50:39 +0100 Subject: [PATCH] set response content type --- src/pages/api/posts.ts | 4 +++- src/pages/feed.json.ts | 5 ++++- src/pages/manifest.json.ts | 4 +++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/pages/api/posts.ts b/src/pages/api/posts.ts index ef5a45ab..1307cf53 100644 --- a/src/pages/api/posts.ts +++ b/src/pages/api/posts.ts @@ -3,5 +3,7 @@ import { getAllPostsForSearch } from '@lib/astro' export const GET: APIRoute = async () => { const allPosts = await getAllPostsForSearch() - return new Response(JSON.stringify(allPosts)) + return new Response(JSON.stringify(allPosts), { + headers: { 'content-type': 'application/json' } + }) } diff --git a/src/pages/feed.json.ts b/src/pages/feed.json.ts index ca7454db..c6533f31 100644 --- a/src/pages/feed.json.ts +++ b/src/pages/feed.json.ts @@ -45,6 +45,9 @@ export async function GET(context: AstroConfig) { } ], items - }) + }), + { + headers: { 'content-type': 'application/json' } + } ) } diff --git a/src/pages/manifest.json.ts b/src/pages/manifest.json.ts index df9a8df3..7d2d2827 100644 --- a/src/pages/manifest.json.ts +++ b/src/pages/manifest.json.ts @@ -33,5 +33,7 @@ export const GET: APIRoute = async () => { icons } - return new Response(JSON.stringify(manifest)) + return new Response(JSON.stringify(manifest), { + headers: { 'content-type': 'application/json' } + }) }