[Pkg-javascript-commits] [dojo] 41/58: fixes #18122, JsonRest _getTarget regression that breaks targets with trailing =
David Prévot
taffit at moszumanska.debian.org
Thu Mar 24 04:28:27 UTC 2016
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to annotated tag 1.10.5
in repository dojo.
commit c63fe83ed671d9a6c8e69eecbcc6868d39925af9
Author: dylans <dylan at dojotoolkit.org>
Date: Tue Dec 22 16:08:38 2015 -0700
fixes #18122, JsonRest _getTarget regression that breaks targets with trailing =
---
store/JsonRest.js | 8 ++++----
tests/store/JsonRest.js | 3 +++
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/store/JsonRest.js b/store/JsonRest.js
index c885e74..ef783c9 100644
--- a/store/JsonRest.js
+++ b/store/JsonRest.js
@@ -61,7 +61,7 @@ return declare("dojo.store.JsonRest", base, {
// descendingPrefix: String
// The prefix to apply to sort attribute names that are ascending
descendingPrefix: "-",
-
+
_getTarget: function(id){
// summary:
// If the target has no trailing '/', then append it.
@@ -69,7 +69,7 @@ return declare("dojo.store.JsonRest", base, {
// The identity of the requested target
var target = this.target;
if(typeof id != "undefined"){
- if(target.charAt(target.length-1) == '/'){
+ if((target.charAt(target.length-1) == '/') || (target.charAt(target.length-1) == '=')){
target += id;
}else{
target += '/' + id;
@@ -77,7 +77,7 @@ return declare("dojo.store.JsonRest", base, {
}
return target;
},
-
+
get: function(id, options){
// summary:
// Retrieves an object by its identity. This will trigger a GET request to the server using
@@ -223,4 +223,4 @@ return declare("dojo.store.JsonRest", base, {
}
});
-});
\ No newline at end of file
+});
diff --git a/tests/store/JsonRest.js b/tests/store/JsonRest.js
index ed2c18c..c15da38 100644
--- a/tests/store/JsonRest.js
+++ b/tests/store/JsonRest.js
@@ -41,6 +41,9 @@ define(["doh/main", "require", "dojo/_base/lang", "dojo/store/JsonRest"], functi
// and with the slash
store.target = store.target + '/';
t.is(store.target + "foo", store._getTarget("foo"));
+ // and with an equals sign
+ store.target = store.target.slice(0, -1);
+ t.is(store.target + "=foo", store._getTarget("foo"));
},
function testQueryIterative(t){
var d = new doh.Deferred();
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/dojo.git
More information about the Pkg-javascript-commits
mailing list