From d5036a4359eba2d810f55341ea931595cbb092c2 Mon Sep 17 00:00:00 2001 From: JaeSeoKim Date: Mon, 18 Oct 2021 13:27:37 +0900 Subject: [PATCH] Fix: sitemap.xml wrong method response --- pages/sitemap.xml.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pages/sitemap.xml.tsx b/pages/sitemap.xml.tsx index 7780913..6c30ae6 100644 --- a/pages/sitemap.xml.tsx +++ b/pages/sitemap.xml.tsx @@ -6,7 +6,8 @@ import { getSiteMaps } from 'lib/get-site-maps' export const getServerSideProps: GetServerSideProps = async ({ req, res }) => { if (req.method !== 'GET') { res.statusCode = 405 - res.write({ error: 'method not allowed' }) + res.setHeader("Content-Type", "application/json") + res.write(JSON.stringify({ error: "method not allowed" })) res.end() return { props: {}