Skip to content

Commit

Permalink
fix issue levinunnink#27 : add CORS headers to google script
Browse files Browse the repository at this point in the history
  • Loading branch information
abdohwebdev committed Sep 26, 2024
1 parent 6a712bb commit faf74c2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions appscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ function doPost (e) {
return ContentService
.createTextOutput(JSON.stringify({ 'result': 'success', 'row': nextRow }))
.setMimeType(ContentService.MimeType.JSON)
.setHeader('Access-Control-Allow-Origin', '*');
}

catch (e) {
return ContentService
.createTextOutput(JSON.stringify({ 'result': 'error', 'error': e }))
.setMimeType(ContentService.MimeType.JSON)
.setHeader('Access-Control-Allow-Origin', '*');
}

finally {
Expand Down

0 comments on commit faf74c2

Please sign in to comment.