diff --git a/mithril.js b/mithril.js index ff3f4219..33e8ab4f 100644 --- a/mithril.js +++ b/mithril.js @@ -864,6 +864,9 @@ Mithril = m = new function app(window, undefined) { if (options.serialize == JSON.stringify && options.data && options.method != "GET") { xhr.setRequestHeader("Content-Type", "application/json; charset=utf-8") } + if (options.deserialize == JSON.parse) { + xhr.setRequestHeader("Accept", "application/json, text/*"); + } if (typeof options.config == "function") { var maybeXhr = options.config(xhr, options) if (maybeXhr != null) xhr = maybeXhr