|
|
|
|
@ -71,7 +71,7 @@ function sendJson(res, status, obj) {
@@ -71,7 +71,7 @@ function sendJson(res, status, obj) {
|
|
|
|
|
const body = JSON.stringify(obj); |
|
|
|
|
res.writeHead(status, { |
|
|
|
|
'Content-Type': 'application/json; charset=utf-8', |
|
|
|
|
'Access-Control-Allow-Origin': 'http://127.0.0.1:8766', |
|
|
|
|
'Access-Control-Allow-Origin': '*', |
|
|
|
|
'Access-Control-Allow-Headers': 'Content-Type, Authorization', |
|
|
|
|
'Access-Control-Allow-Methods': 'GET, POST, PUT, OPTIONS', |
|
|
|
|
}); |
|
|
|
|
@ -259,7 +259,7 @@ const server = http.createServer(async (req, res) => {
@@ -259,7 +259,7 @@ const server = http.createServer(async (req, res) => {
|
|
|
|
|
|
|
|
|
|
if (req.method === 'OPTIONS') { |
|
|
|
|
res.writeHead(204, { |
|
|
|
|
'Access-Control-Allow-Origin': 'http://127.0.0.1:8766', |
|
|
|
|
'Access-Control-Allow-Origin': '*', |
|
|
|
|
'Access-Control-Allow-Headers': 'Content-Type, Authorization', |
|
|
|
|
'Access-Control-Allow-Methods': 'GET, POST, PUT, OPTIONS', |
|
|
|
|
}); |
|
|
|
|
|