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

Set the Content-Type on uploads

Most browsers seem to set this if you forget, but some don't.
This commit is contained in:
Kegan Dougal
2015-08-14 15:09:31 +01:00
parent e859119bde
commit c1c2731f2e

View File

@@ -205,6 +205,9 @@ module.exports.MatrixHttpApi.prototype = {
url += "&filename=" + encodeURIComponent(file.name);
xhr.open("POST", url);
if (file.type) {
xhr.setRequestHeader("Content-Type", file.type);
}
xhr.send(file);
} else {
var queryParams = {