Web App Unable Send Request To Appscript Due To CORS

@Mevi , Is there any method to fix this issue immediately?

Access to fetch at ScriptId from origin ‘https://platform.preview.appgyver.com’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. If an opaque response serves your needs, set the request’s mode to ‘no-cors’ to fetch the resource with CORS disabled.

Hi,

The CORS issue unfortunately is not something that can be fixed from AppGyver side. The mentioned ‘Access-Control-Allow-Origin’ header can only be set from the server side (in this case from Appscript).

You can find some discussion on a similar issue here How do i allow a CORS requests in my google script? - Stack Overflow

@Akseli_Virtanen , thank you for your reply.

Currently I am using mode: ‘no cors’ in my request. I am able to get the response in mobile android and ios. However there is no response in web. How do I solve this?

This is my javascript appgyver script.
image

This is my appscript

function dopost(e) {
var contents = JSON.parse(e.postData.contents);

(other script)…

return ContentService.createTextOutput(JSON.parse(e.parameter.callback) + “(” + JSON.stringify(result)+ “)”).setMimeType(ContentService.MimeType.JAVASCRIPT);
}