Empty Content-Type when uploading file without suffix
JakubOnderka opened this issue · comments
Jakub Onderka commented
If you try to upload file without suffix, empty Content-Type
header is send by Element client. Empty Content-Type
can be blocked by some web application filters.
The reason is this line:
matrix-js-sdk/src/http-api/index.ts
Line 53 in c49a527
It expects that if file content type is unknown, default MIME type application/octet-stream
should be send. But according to specification, for unknown file, File.type
is empty string (see https://developer.mozilla.org/en-US/docs/Web/API/Blob/type). And ??
operator consider empty string as valid value.
So instead ??
operator, ||
should be used.