allow proxy host function, r=tschaub (closes #2128)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@9586 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Éric Lemoine
2009-07-24 12:44:33 +00:00
parent f838aa3a03
commit 1faae2a2a2
2 changed files with 58 additions and 1 deletions

View File

@@ -128,7 +128,11 @@ OpenLayers.Request = {
}
}
if(config.proxy && (url.indexOf("http") == 0)) {
url = config.proxy + encodeURIComponent(url);
if(typeof config.proxy == "function") {
url = config.proxy(url);
} else {
url = config.proxy + encodeURIComponent(url);
}
}
request.open(
config.method, url, config.async, config.user, config.password