Skip to content

Commit

Permalink
Upload missing changes for supporting CORS. See #2
Browse files Browse the repository at this point in the history
  • Loading branch information
aarranz committed May 10, 2017
1 parent 1ed60a2 commit b5db832
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,19 @@ exports.options_eventsource = function options_eventsource(req, res) {
if (origin != null) {
res.header('Access-Control-Allow-Origin', origin);
res.header('Access-Control-Allow-Methods', 'POST, OPTIONS');
res.header('Access-Control-Allow-Headers', 'X-Requested-With');
res.header('Access-Control-Expose-Headers', 'Location');
}
res.send(204);
};

exports.options_eventsource_entry = function options_eventsource_entry(req, res) {
res.header('Connection', 'keep-alive');
var origin = req.header('Origin');
if (origin != null) {
res.header('Access-Control-Allow-Origin', origin);
res.header('Access-Control-Allow-Methods', 'GET, DELETE');
res.header('Access-Control-Allow-Headers', 'X-Requested-With');
}
res.send(204);
};
Expand Down

0 comments on commit b5db832

Please sign in to comment.