Like you said, It’s not a proxy issue, I believe it’s org specific javascript execution issue.. I have tested above proxy in one of the cloud org with service callout pointed to my BaaS collection & it works perfectly fine.
Can you please let us know more details regarding the different orgs you are mentioning ? Which ORG it’s working (OnPremises / OnCloud) (Version Number ) ? Which ORG it’s NOT working (OnPremises / OnCloud) (Version Number ) ?
PS: Navigate to “/buildInfo” in Management UI to find version info.
The JS code seems fine; benign. I don’t know why there’d be a ScriptSecurityError.
Having the org name + environment name will help.
If you are using an Apigee-managed edge (in the public cloud) we can check stacktraces - that wouldn’t be available to you. If you are using a self-managed Edge (OPDK), then you can check the message processor system.log yourself for a stacktrace that may provide more information and context around the error.
Also, it may be relevant. what does “econtenttype” look like? In json? That is the thing that is being parsed by the JS module. What is it?
If I were diagnosing this myself, I’d insert some other diagnostic steps in the JS. setting other variables, or even printing things, and then viewing those results in the trace window.
Also maybe use a try..catch in there - if you can catch the Exception , it may give you more information.