[Pkg-javascript-commits] [dojo] 106/149: fixes #18122, JsonRest _getTarget regression that breaks targets with trailing =
David Prévot
taffit at moszumanska.debian.org
Sat Feb 27 03:13:53 UTC 2016
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository dojo.
commit 606f888b577a527da4272c6f8cf4887395b81078
Author: dylans <dylan at dojotoolkit.org>
Date: Tue Dec 22 16:00:43 2015 -0700
fixes #18122, JsonRest _getTarget regression that breaks targets with trailing =
---
store/JsonRest.js | 8 ++++----
tests/unit/store/JsonRest.js | 4 ++++
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/store/JsonRest.js b/store/JsonRest.js
index c885e74..05c3af3 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/unit/store/JsonRest.js b/tests/unit/store/JsonRest.js
index d438e85..fa7e0ea 100644
--- a/tests/unit/store/JsonRest.js
+++ b/tests/unit/store/JsonRest.js
@@ -200,6 +200,10 @@ define([
},
'with slash': function () {
assert.equal(store.target + 'foo', store._getTarget('foo'));
+ },
+ 'with equals': function () {
+ store.target = store.target.slice(0, -1) + '=';
+ assert.equal(store.target + 'foo', store._getTarget('foo'));
}
},
--
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