#292 don't duplicate querystring parameters if dataType and method are both present

This commit is contained in:
Leo Horie 2014-10-02 17:48:49 -04:00
parent 481d3feead
commit 8749379703
2 changed files with 34 additions and 1 deletions

View file

@ -872,7 +872,7 @@ Mithril = m = new function app(window, undefined) {
}
function bindData(xhrOptions, data, serialize) {
if (data && Object.keys(data).length > 0) {
if (xhrOptions.method == "GET") {
if (xhrOptions.method == "GET" && xhrOptions.dataType != "jsonp") {
xhrOptions.url = xhrOptions.url + (xhrOptions.url.indexOf("?") < 0 ? "?" : "&") + buildQueryString(data)
}
else xhrOptions.data = serialize(data)