[OpenLayers-Users] Request & ProxyHost Question

Tim Schaub tschaub at opengeo.org
Wed Jan 21 04:29:29 EST 2009


Hey-

Semantica wrote:
> Hi all,
> 
> I am considering doing my getLegend requests via XMLHTTPRequest instead of
> img.src and have run into the common problem of cross-site scripting errors.
> Does someone have an example on how to work around this issue using a
> proxy-host or something else? Out of interest, what does OL use to load the
> map images from a WMS? Does it use the OpenLayers.ProxyHost?
> 

The source for image tiles is set via the src attribute on Image 
objects.  That is, img.src = "foo.png".

Unless you are relying on the data url scheme (not in IE < 8 ) [1], how 
do you plan on using the image data you get from your XMLHttpRequest? 
Referrer spoofing and url caching?

If you want to set up a proxy and use OpenLayers.ProxyHost, see if the 
FAQ helps [2].

[1] http://en.wikipedia.org/wiki/Data_URI_scheme#Web_browser_support
[2] http://faq.openlayers.org/proxyhost/all/

> Thank you in advance!


-- 
Tim Schaub
OpenGeo - http://opengeo.org
Expert service straight from the developers.



More information about the Users mailing list