From ce20520f3a4aa60ffa9260692da950c797f93cea Mon Sep 17 00:00:00 2001 From: valtron Date: Tue, 14 Apr 2015 11:46:40 -0600 Subject: [PATCH] Canonicalize `options.method` in m.request --- mithril.js | 1 + 1 file changed, 1 insertion(+) diff --git a/mithril.js b/mithril.js index fe994854..c158c34f 100644 --- a/mithril.js +++ b/mithril.js @@ -1027,6 +1027,7 @@ var m = (function app(window, undefined) { var extract = xhrOptions.extract || function(xhr) { return xhr.responseText.length === 0 && deserialize === JSON.parse ? null : xhr.responseText }; + xhrOptions.method = (xhrOptions.method || 'GET').toUpperCase(); xhrOptions.url = parameterizeUrl(xhrOptions.url, xhrOptions.data); xhrOptions = bindData(xhrOptions, xhrOptions.data, serialize); xhrOptions.onload = xhrOptions.onerror = function(e) {