OpenLayers.Request issue method creates URLs such as http://service?&key=value, p=fvanderbiest, r=me (closes #3055)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@11133 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
bartvde
2011-02-17 15:04:53 +00:00
parent 0781655e19
commit 04acbeeb0e
2 changed files with 15 additions and 10 deletions
+13 -2
View File
@@ -20,7 +20,7 @@
function test_issue(t) {
setup();
t.plan(21);
t.plan(22);
var request, config;
var proto = OpenLayers.Request.XMLHttpRequest.prototype;
var issue = OpenLayers.Function.bind(OpenLayers.Request.issue,
@@ -81,7 +81,18 @@
t.eq(url, config.url + "&foo=bar", "existing query string gets extended with &");
}
request = issue(config);
// test that query string doesn't get ? followed by &
config = {
method: "GET",
url: "http://example.com/service?",
params: {"foo": "bar"}
};
proto.open = function(method, url, async, user, password) {
t.eq(url, config.url + "foo=bar", "existing query string ending with ? gets extended without &");
}
request = issue(config);
// reset open method
proto.open = _open;