1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-28 05:03:59 +03:00

Use a default content type if the browser doesn't give us one: home servers require a content type header.

This commit is contained in:
David Baker
2015-10-02 18:36:09 +01:00
parent a16ded9f4d
commit 682880d0c9

View File

@@ -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 {