From 75787a14839dcaa1e15552ed751296813a3aee53 Mon Sep 17 00:00:00 2001 From: Leo Horie Date: Thu, 25 Sep 2014 07:25:26 -0400 Subject: [PATCH] update change log --- docs/change-log.md | 1 + tests/mithril-tests.js | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/change-log.md b/docs/change-log.md index cd67f915..ba4e5c76 100644 --- a/docs/change-log.md +++ b/docs/change-log.md @@ -20,6 +20,7 @@ - fixed incorrect diff when document is root, and html element is omitted - fixed querystring clobbering in links w/ config:m.route [#261](https://github.com/lhorie/mithril.js/issues/261) - fixed rare bug that made events get dropped [#214](https://github.com/lhorie/mithril.js/issues/214) +- don't send Content-Type header if there's no request data [#280](https://github.com/lhorie/mithril.js/issues/280) --- diff --git a/tests/mithril-tests.js b/tests/mithril-tests.js index 8064beb2..96f2a3b6 100644 --- a/tests/mithril-tests.js +++ b/tests/mithril-tests.js @@ -1553,11 +1553,18 @@ function testMithril(mock) { }) test(function() { var error = m.prop("no error") - var prop = m.request({method: "POST", url: "test"}).then(null, error) + var prop = m.request({method: "POST", url: "test", data: {foo: 1}}).then(null, error) var xhr = mock.XMLHttpRequest.$instances.pop() xhr.onreadystatechange() return xhr.$headers["Content-Type"] == "application/json; charset=utf-8" }) + test(function() { + var error = m.prop("no error") + var prop = m.request({method: "POST", url: "test"}).then(null, error) + var xhr = mock.XMLHttpRequest.$instances.pop() + xhr.onreadystatechange() + return xhr.$headers["Content-Type"] === undefined + }) // m.request over jsonp test(function(){