event.renderdata as json

I’m trying to use event.rederdata for use in a REST API. Only problem is the JSON always starts with two leading slashes (//). This isn’t vaid JSON. Is there a reason for this? Is there an option to remove them? I read the docs and don’t see one. I’m passing renderdata a simple query.

Do you have script protect enabled in your CF administrator?

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

I turned this off, restarted CF and still happens. Running CF11.

Specify whether to protect Form, URL, CGI, and Cookie scope variables from cross-site scripting attacks.

Oops, sorry-- I mean the JSON prefix setting.

http://www.adobe.com/devnet/coldfusion/articles/ajax_security.html

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Yep, I just saw that. Problem is that it’s unchecked. So I even checked it. I even changed // to 00 and no matter what I do // stays. Looks like a CF bug issue.

Just curious, but do you get the same results if you use CF’s serializeJSON directly?

Any chance the setting is being overwritten in your Application.cfc?

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Bingo. Thank you.