Feature: add server response headers for CORS (#939)

Co-authored-by: long <iamlongalong@gmail.com>
This commit is contained in:
longalong
2022-07-16 10:36:00 +08:00
committed by GitHub
parent 0a9e1692ee
commit fb69bad2cf
3 changed files with 13 additions and 3 deletions

View File

@@ -4,7 +4,10 @@ export const handleResponse = ({
response,
statusCode = 200,
header = {
'Content-Type': 'application/json'
'Content-Type': 'application/json',
'access-control-allow-headers': '*',
'access-control-allow-methods': 'POST, GET, OPTIONS',
'access-control-allow-origin': '*'
},
body = {
success: false