add 'CORS' header to server responses
This commit is contained in:
parent
0a74b8bbcc
commit
505400d1f4
1 changed files with 2 additions and 0 deletions
|
@ -78,6 +78,8 @@ function endRequest(request, response, msg, code) {
|
||||||
object.data = msg;
|
object.data = msg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
||||||
|
response.setHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
|
||||||
response.writeHead(object.code);
|
response.writeHead(object.code);
|
||||||
response.end(object.data);
|
response.end(object.data);
|
||||||
logger.http(object);
|
logger.http(object);
|
||||||
|
|
Loading…
Reference in a new issue