Skip to content

Commit

Permalink
build
Browse files Browse the repository at this point in the history
  • Loading branch information
pygy committed Oct 13, 2017
1 parent 5200dde commit e2ddbf2
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 45 deletions.
4 changes: 2 additions & 2 deletions mithril.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,10 @@ var _8 = function($window, Promise) {
_abort.call(xhr)
}
xhr.open(args.method, args.url, typeof args.async === "boolean" ? args.async : true, typeof args.user === "string" ? args.user : undefined, typeof args.password === "string" ? args.password : undefined)
if (args.serialize === JSON.stringify && useBody) {
if (args.serialize === JSON.stringify && useBody && !(args.headers && args.headers.hasOwnProperty("Content-Type"))) {
xhr.setRequestHeader("Content-Type", "application/json; charset=utf-8")
}
if (args.deserialize === deserialize) {
if (args.deserialize === deserialize && !(args.headers && args.headers.hasOwnProperty("Accept"))) {
xhr.setRequestHeader("Accept", "application/json, text/*")
}
if (args.withCredentials) xhr.withCredentials = args.withCredentials
Expand Down
Loading

0 comments on commit e2ddbf2

Please sign in to comment.