-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjusted the url package to encode nested objects and arrays (to help…
… address #5065). (#8261) * Adjusted the url package common code to encode nested objects and arrays properly (to help address #5065). * Adjusted to make sure a 'hasOwnProperty' param name is handled.
- Loading branch information
Showing
4 changed files
with
41 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Tinytest.add('url - serializes params to query correctly', function (test) { | ||
var hash = { | ||
filter: { | ||
type: 'Foo', | ||
id_eq: 15, | ||
}, | ||
array: ['1', 'a', 'dirty[]'], | ||
hasOwnProperty: 'horrible param name', | ||
}; | ||
var query = | ||
'filter[type]=Foo&filter[id_eq]=15&array[0]=1&array[1]=a' | ||
+ '&array[2]=dirty%5B%5D&hasOwnProperty=horrible+param+name'; | ||
test.equal(URL._encodeParams(hash), query); | ||
}); |