Hi All,
I am having an error that Access-Control-Allow-Origin header is not present.
I am currently using the FW/1 version 4.1 and run on Lucee 5.0.
From the controller I am using this statement:
framework.renderData().data(rc.jsonResult).type("json").
I set the preflightOptions either true or false and set the optionsAccessControl.origin = "*" and giving me the error.
However if I am using the view like below and everything is fine.
<cfheader name="Access-Control-Allow-Origin" value="*">
<cfheader name="Access-Control-Allow-Methods" value="DELETE,GET,HEAD,PATCH,POST,PUT">
<cfheader name="Access-Control-Max-Age" value="3600">
<cfheader name="Access-Control-Allow-Headers" value="Authorization, Content-Type" />
<cfcontent type="application/json; charset=utf-8">
<cfoutput>#serializejson(rc.jsonResult)#</cfoutput>
I prefer to use the built-in renderData() instead using my own view but for some reason I got this Access-Control-Allow-Origin not present.
I am not sure what I need to correct this. Please help!
Thanks in advance.
Best.
JY.