Putting this out to the world since I ran into thi...
# cfml-general
j
Putting this out to the world since I ran into this issue today. I am currently working on integrating with the RingCentral API and I kept getting errors when I was trying to authenticate. I ran my tests in Postman, thru Curl, and I even tested with Fetch using my browser’s console and they all worked but ACF would keep erroring out. I then decided to test with Lucee and low and behold it worked. I then decided to compare documentation and it appears the issue was with ACF encoding the formField type by default, which Lucee does not do, they only use the encoded setting for CGI and url types while Adobe uses it for FormField and CGI types, url types are always encoded. The fix, set encoded to
false
for the 2
formField
values … not too many hairs ripped out today but thank you @bdw429s for CommandBox allowing me to run a quick test 🙂
👍🏼 2
👍🏻 1
👍 1
a
This reads to me like a shortfall in Lucee, in two ways: • there's no good reason to not follow CF here. Not doing so just creates situations like yours, @jc • The RFC is uncharacteristically lose when it comes to encoding form values, but it does indicate it's a thing that ought to be considered when passing non-US-ASCII data in the value. It falls should of using the usual "SHOULD" / "MUST", and just uses "can". https://httpwg.org/specs/rfc9110.html#fields.values. Lucee's approach requires the CFML dev to hand-crank the encoding of fields, where CF's approach takes care of it. I think CF's approach is the more CFML-idiomatic approach to the issue. Looking more into it, there is an open issue in Jira relating to this: https://luceeserver.atlassian.net/browse/LDEV-2250, but it's raising an issue about the encoding always being ON with Lucee, and no way to disable. I wonder if someone unthinkingly went "I know how to fix this, I'll just switch it off and remove the option to switch it on"..? I can't be arsed finding the relevant bit of source code and looking at its history. Does seem like Lucee is not intentionally diverging from CF here, just its changes haven't been very... erm... mindful.
I also note that Lucee was being a bit ham-fisted with the encoding too, by the looks, based on a comment on that ticket:
the encoding of spaces to plus symbols is breaking the integration
(from one of my former colleagues, no less!) Spaces and plus symbols oughtn't be encoded in this context: they already fall within the scope of allowable characters. Looks like Lucee was using URL encoding for this, which isn't so legit when the values aren't in the URL (thus causing Andy's issue above).
j
Thanks for the info @Adam Cameron. In the end, the issue was me, I needed to revisit the docs and understand what I needed to do. So on the positive note, having two different results led me to do that, and maybe if they both had the same result I would have done the same, or pulled out more hair .. LOL .. who knows.
😜 1