tweak CORS response headers
This commit is contained in:
parent
a4a83e2607
commit
9f3cdfeea0
1 changed files with 2 additions and 2 deletions
4
index.js
4
index.js
|
|
@ -66,11 +66,11 @@ aedes.on('publish', function(packet, client) {
|
|||
});
|
||||
|
||||
var web = http.createServer(function(req, res) {
|
||||
|
||||
// Set CORS headers
|
||||
res.setHeader('Access-Control-Allow-Origin', '*');
|
||||
res.setHeader('Access-Control-Request-Method', '*');
|
||||
res.setHeader('Access-Control-Allow-Methods', 'OPTIONS, GET');
|
||||
res.setHeader('Access-Control-Allow-Headers', '*');
|
||||
res.setHeader('Access-Control-Allow-Headers', 'DNT,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type');
|
||||
|
||||
var topic = url.parse(req.url).pathname;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue