Fix silly typo which neither Paul nor I caught, with tests this time. Thanks

Tim for catching it.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@5866 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2008-01-24 02:12:21 +00:00
parent f4b4e85433
commit 7af5b1c657
3 changed files with 22 additions and 1 deletions

View File

@@ -60,7 +60,7 @@ OpenLayers.loadURL = function(uri, params, caller,
onComplete, onFailure) {
if (OpenLayers.ProxyHost && OpenLayers.String.startsWith(uri, "http")) {
uri = OpenLayers.ProxyHost + escapeURIComponent(uri);
uri = OpenLayers.ProxyHost + encodeURIComponent(uri);
}
var success = (onComplete) ? OpenLayers.Function.bind(onComplete, caller)

View File

@@ -1,4 +1,5 @@
<ul id="testlist">
<li>test_Ajax.html</li>
<li>test_BaseTypes.html</li>
<li>BaseTypes/test_Bounds.html</li>
<li>BaseTypes/test_Class.html</li>
@@ -24,6 +25,7 @@
<li>Format/test_GeoRSS.html</li>
<li>Format/test_GML.html</li>
<li>Format/test_JSON.html</li>
<li>Format/test_OSM.html</li>
<li>Format/test_KML.html</li>
<li>Format/test_SLD.html</li>
<li>Format/test_WKT.html</li>

19
tests/test_Ajax.html Normal file
View File

@@ -0,0 +1,19 @@
<html>
<head>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
function test_Ajax_loadUrl(t) {
t.plan(1);
var req = OpenLayers.Ajax.Request;
OpenLayers.ProxyHost = "/?url=";
OpenLayers.Ajax.Request = function(uri) {
t.eq(uri, "/?url=http%3A%2F%2Fexample.com%2F%3Fformat%3Dimage%2Bkml", "URI matches what we expect from loadurl");
}
OpenLayers.loadURL("http://example.com/?format=image+kml");
}
</script>
</head>
<body>
</body>
</html>