I have added below code in RED.js to enables header for Node-RED. But Access-Control-Allow-Origin header is not coming as http://google.com/ . its coming as *.
Other headers are reflecting in node-red.
You seem to be amending the core of Node-RED to make it possible to access Node-RED endpoints from an unsecured google location.
This strikes me as unwise on several levels.
Firstly that I doubt that Nick will want this in the core code. Certainly I wouldn't be happy to see it. Additionally, I'm not sure that it is even necessary to put it there but we don't have enough information about what you are trying to do to be able to help.
Secondly, the purpose of those headers is to enable secure connections between domains and so trying to include a non-TLS connected domain is probably not wise. If I remember correctly, I'm not even sure that you can do anything other than "*" for a non-TLS connection.
Not unless you can explain more about what you are trying to achieve and why you can't do it at the flow level rather than having to hack the core.
I am trying to enable for editor as whole. Actually I want to disable all communication except mydomain.com from node-red.
Basically I am trying to whitelist only my domain (One or More)