[OpenLayers-Users] Problem with cross-origin

Phil Scadden p.scadden at gns.cri.nz
Sun Jul 20 14:50:43 PDT 2014


> Is there any way to allow each host? Not only those from the allowedHosts
> array.
>
> Or is possible to add host to this array via OpenLayers?
>
You have to do this with server-side code. You need to be very careful 
with security since you dont want to give someone a way to turn this 
into an open proxy? I gather this is so you can give users a way to add 
layers from arbitrary server to a map? If so, then you need a much more 
expanded proxy application. You should pass the URL to add to a handler 
which can then check for a valid getCaps response before adding the 
server to the allowed list. You need to think about persistence as well. 
No simple answers and any code is highly dependent on your server side 
environment.

Notice: This email and any attachments are confidential.
If received in error please destroy and immediately notify us.
Do not copy or disclose the contents.



More information about the Users mailing list