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
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:
@@ -207,6 +207,10 @@ module.exports.MatrixHttpApi.prototype = {
|
|||||||
xhr.open("POST", url);
|
xhr.open("POST", url);
|
||||||
if (file.type) {
|
if (file.type) {
|
||||||
xhr.setRequestHeader("Content-Type", 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);
|
xhr.send(file);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user