Fix: robots.txt wrong method response

This commit is contained in:
JaeSeoKim
2021-10-18 13:26:55 +09:00
committed by GitHub
parent 37411d7330
commit 882a815106

View File

@@ -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: {}