From 882a815106abddb261b166057ceca9e6253c6e4f Mon Sep 17 00:00:00 2001 From: JaeSeoKim Date: Mon, 18 Oct 2021 13:26:55 +0900 Subject: [PATCH] Fix: robots.txt wrong method response --- pages/robots.txt.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pages/robots.txt.tsx b/pages/robots.txt.tsx index cf5273e..e79c843 100644 --- a/pages/robots.txt.tsx +++ b/pages/robots.txt.tsx @@ -4,7 +4,8 @@ import { host } from 'lib/config' 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: {}