Skip to content

Commit

Permalink
Support CORS by default
Browse files Browse the repository at this point in the history
  • Loading branch information
robinske committed Jul 17, 2020
1 parent 0fcb5b6 commit da3e1d8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@
"last 1 safari version"
]
}
}
}
6 changes: 3 additions & 3 deletions serverless/functions/check-verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ exports.handler = function(context, event, callback) {
response.appendHeader('Content-Type', 'application/json');

// uncomment to support CORS
// response.appendHeader('Access-Control-Allow-Origin', '*');
// response.appendHeader('Access-Control-Allow-Methods', 'POST, OPTIONS');
// response.appendHeader('Access-Control-Allow-Headers', 'Content-Type');
response.appendHeader('Access-Control-Allow-Origin', '*');
response.appendHeader('Access-Control-Allow-Methods', 'POST, OPTIONS');
response.appendHeader('Access-Control-Allow-Headers', 'Content-Type');

if (typeof event.to === 'undefined' ||
typeof event.verification_code === 'undefined') {
Expand Down
6 changes: 3 additions & 3 deletions serverless/functions/start-verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ exports.handler = function(context, event, callback) {
response.appendHeader('Content-Type', 'application/json');

// uncomment to support CORS
// response.appendHeader('Access-Control-Allow-Origin', '*');
// response.appendHeader('Access-Control-Allow-Methods', 'POST, OPTIONS');
// response.appendHeader('Access-Control-Allow-Headers', 'Content-Type');
response.appendHeader('Access-Control-Allow-Origin', '*');
response.appendHeader('Access-Control-Allow-Methods', 'POST, OPTIONS');
response.appendHeader('Access-Control-Allow-Headers', 'Content-Type');

if (typeof event.to === 'undefined') {
response.setBody({
Expand Down

0 comments on commit da3e1d8

Please sign in to comment.