Skip to content

Commit

Permalink
Update Content-Type and Charset in API response headers
Browse files Browse the repository at this point in the history
  • Loading branch information
hrenaud committed Feb 17, 2024
1 parent 7494f58 commit 1202426
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/pages/api/[lang]/getFicheById/[id].ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ export async function GET({ params, request }) {
return new Response(JSON.stringify(o), {
status: 200,
headers: {
"Content-Type": "application/json;charset=utf-8",
"Content-Type": "application/json; charset=UTF-8",
Charset: "UTF-8",
},
});
}
Expand All @@ -46,7 +47,6 @@ export async function getStaticPaths() {
lang,
id: entry.data.refID,
},
props: { entry, entries },
};
});

Expand Down
5 changes: 3 additions & 2 deletions src/pages/api/[lang]/getFiches.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { code_languages } from "@i18n/ui";
import type { APIRoute } from "astro";
import { code_languages } from "@i18n/ui";
import { getCollection } from "astro:content";
import { getRefConfig } from "referentiel-config";

Expand Down Expand Up @@ -33,7 +33,8 @@ export const GET: APIRoute = async ({ params, request }) => {
return new Response(JSON.stringify(output), {
status: 200,
headers: {
"Content-Type": "application/json;charset=utf-8",
"Content-Type": "application/json; charset=UTF-8",
Charset: "UTF-8",
},
});
};
Expand Down

0 comments on commit 1202426

Please sign in to comment.