diff --git a/lib/http-api.js b/lib/http-api.js index 3dd86615c..d771471f7 100644 --- a/lib/http-api.js +++ b/lib/http-api.js @@ -207,6 +207,10 @@ module.exports.MatrixHttpApi.prototype = { xhr.open("POST", url); if (file.type) { xhr.setRequestHeader("Content-Type", file.type); + } else { + // if the file doesn't have a mime type, use a default since + // the HS errors if we don't supply one. + xhr.setRequestHeader("Content-Type", 'application/octet-stream'); } xhr.send(file); } else {