Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
Check if content-type header exists
Browse files Browse the repository at this point in the history
Fixes #19
  • Loading branch information
elliottsj committed Aug 16, 2014
1 parent 04e5e9b commit d956201
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core-ajax.html
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,10 @@
if (args.headers && typeof(args.headers) == 'string') {
args.headers = JSON.parse(args.headers);
}
if (this.contentType) {
var hasContentType = Object.keys(args.headers).some(function (header) {
return header.toLowerCase() === 'content-type';
});
if (!hasContentType && this.contentType) {
args.headers['content-type'] = this.contentType;
}
if (this.handleAs === 'arraybuffer' || this.handleAs === 'blob' ||
Expand Down

0 comments on commit d956201

Please sign in to comment.