Hi,
I shifted from windows machine to a Mac with intel chip and figured that it’s better to use command box’s ad hoc server for development purpose.
The ColdFusion ColdBox API needs to enable “Access-Control-Allow-Credentials” to “true” however I am unable to set it in the server.json file using rules.
I have tried the following codes in the rules section of server.json
“set(attribute=’%{o.Access-Control-Allow-Credentials}’, value=‘true’)”,
“set(attribute=’%{o.Access-Control-Allow-Credentials}’)”,
“header(‘Access-Control-Allow-Credentials’, ‘true’”,
Here is the server.json file which I am using.
{
“name”:“api”,
“app”:{
“cfengine”:“adobe@2018.0.14+330003”
},
“web”:{
“host”:“localv5.com”,
“http”:{
“port”:“1025”
},
“rewrites”:{
“enable”:“true”
},
“rules”:[
“set(attribute=’%{o,Access-Control-Allow-Origin}’, value=‘http://localv5.com:4200’)”,
“set(attribute=’%{o,Access-Control-Allow-Methods}’, value=‘GET, POST, HEAD, OPTIONS’)”,
“set(attribute=’%{o.Access-Control-Allow-Credentials}’, value=‘true’)”,
“set(attribute=’%{o,Access-Control-Allow-Headers}’, value=‘Authorization’)”
]
}
}
Here is the error as seen from the browser console.
Credentials flag is true, but Access-Control-Allow-Credentials is not “true”.
Let me know what can be done to allow the credentials in response header or share any doc that can be followed.
Any help would be appreciated.