Skip to content

Commit

Permalink
Do not force content-type of application/octet-stream when multipart=…
Browse files Browse the repository at this point in the history
…false. Address #1208.
  • Loading branch information
walter authored and jayarjo committed Aug 7, 2015
1 parent 88955e6 commit 68e8321
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/plupload.js
Original file line number Diff line number Diff line change
Expand Up @@ -1185,6 +1185,16 @@ plupload.Uploader = function(options) {
}
break;

case 'headers':
var headers = {};
if (typeof(value) === 'object') {
plupload.each(value, function(value, key) {
headers[key.toLowerCase()] = value;
});
}
settings.headers = headers;
break;

case 'http_method':
settings[option] = value.toUpperCase() === 'PUT' ? 'PUT' : 'POST';
break;
Expand Down Expand Up @@ -2394,7 +2404,9 @@ plupload.File = (function() {

xhr.open(options.http_method, url, true);

xhr.setRequestHeader('Content-Type', 'application/octet-stream'); // Binary stream header
if (plupload.isEmptyObj(options.headers) || !options.headers['content-type']) {
xhr.setRequestHeader('content-type', 'application/octet-stream'); // binary stream header
}

// Set custom headers
plupload.each(options.headers, function(value, name) {
Expand Down

0 comments on commit 68e8321

Please sign in to comment.