returnFormat is missing from getMetaData when it is set to 'xml'

When I was looking to an issue that @jjblodg was having on the forum ( Remote Function Content-Type difference between Lucee and ColdFusion - #7 by jjblodg ), I noticed that if a function has a returnFormat attribute set to ‘xml’, then the returnFormat key is missing from the function’s metadata when using getMetaData(). This happens with Lucee 6 and 5.4.3.16

You can see a stripped down version of this in the following gist:

It looks like it is caused by this section of code:

I just wanted to check if I am OK to log this as a bug on jira?

@martin Yeah, it seems to be a valid bug. Please file a bug on Jira.

Thanks for the confirmation. I have submitted a bug on jira:
https://luceeserver.atlassian.net/browse/LDEV-4783

I have also created a test for this and submitted a pull request for a fix: