From 08342bca6dbb141d6cf0f0f74002713da8708318 Mon Sep 17 00:00:00 2001 From: wonderlandpark Date: Sat, 29 May 2021 21:52:42 +0900 Subject: [PATCH] fix: set header first --- utils/ResponseWrapper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/ResponseWrapper.ts b/utils/ResponseWrapper.ts index 391101f..c940c3c 100644 --- a/utils/ResponseWrapper.ts +++ b/utils/ResponseWrapper.ts @@ -7,8 +7,8 @@ export default function ResponseWrapper( ) { if (!code) throw new Error('`code` is required.') if (!http.STATUS_CODES[code]) throw new Error('Invalid http code.') - res.status(code) res.setHeader('Access-Control-Allow-Origin', process.env.KOREANBOTS_URL) + res.status(code) res.json({ code, data,