Hi,
I’ve been handed a CF2018 app but we now use Lucee therefore I need to convert it, the app works 100% fine when run under CF2018 but when the same code is run under Lucee I get errors showing in the console such as 422 (Unprocessable Entity) polyfills.js:1
The issue seems to be originating from a file called get_evaluation.cfm which contains the following cfscript code:
response = getPageContext().getResponse();
response.setHeader('Content-Type', 'application/json');
try {
request = getHTTPRequestData();
body = deserializeJSON(toString(request.content));
uuid = body['uuid'];
if (isNull(uuid)) throw(type="UnprocessableEntityHTTPResponse",message="The request you submitted was invalid");
evaluation = createObject('component', '/models.evaluation');
try {
evaluation.loadLatestByUuid(uuid).loadSections().loadElements();
output = {
evaluation = evaluation.toStruct()
};
response.setStatus(200);
} catch (any error) {
output = {
message = "The requested evaluation could not be found",
error = error
};
response.setStatus(404);
}
} catch (any error) {
output = {
message = error.message
};
response.setStatus(422);
}
writeOutput(serializeJSON(output));
If I run this file by itself I get the following:
{“MESSAGE”:“key [CONTENT] doesn’t exist in the request scope”}.
It appears that it’s not finding the uuid value. Is there something obvious here that needs changed in order to get it working again?