added multi argument brackets
This commit is contained in:
parent
45ee2751e7
commit
da4ef441fd
2 changed files with 2 additions and 2 deletions
|
|
@ -693,7 +693,7 @@ var m = (function app(window, undefined) {
|
||||||
var pair = value != null && (valueType === OBJECT) ?
|
var pair = value != null && (valueType === OBJECT) ?
|
||||||
buildQueryString(value, key) :
|
buildQueryString(value, key) :
|
||||||
valueType === ARRAY ?
|
valueType === ARRAY ?
|
||||||
value.map(function(item) {return encodeURIComponent(key) + "=" + encodeURIComponent(item)}).join("&") :
|
value.map(function(item) {return encodeURIComponent(key + "[]") + "=" + encodeURIComponent(item)}).join("&") :
|
||||||
encodeURIComponent(key) + "=" + encodeURIComponent(value)
|
encodeURIComponent(key) + "=" + encodeURIComponent(value)
|
||||||
str.push(pair)
|
str.push(pair)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1799,7 +1799,7 @@ function testMithril(mock) {
|
||||||
test(function() {
|
test(function() {
|
||||||
var prop = m.request({method: "GET", url: "test", data: {foo: [1, 2]}})
|
var prop = m.request({method: "GET", url: "test", data: {foo: [1, 2]}})
|
||||||
mock.XMLHttpRequest.$instances.pop().onreadystatechange()
|
mock.XMLHttpRequest.$instances.pop().onreadystatechange()
|
||||||
return prop().url === "test?foo=1&foo=2"
|
return prop().url === "test?foo%5B%5D=1&foo%5B%5D=2"
|
||||||
})
|
})
|
||||||
|
|
||||||
// m.request over jsonp
|
// m.request over jsonp
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue