You've already forked matrix-js-sdk
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:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user