Philipp Hörist pushed to branch master at gajim / gajim
Commits:
8ad0d5fd by wurstsalat at 2025-09-04T05:15:40+00:00
imprv: HTTP File Upload: Improve mime type detection when sending files
Fixes #12450
- - - - -
1 changed file:
- gajim/common/modules/httpupload.py
Changes:
=====================================
gajim/common/modules/httpupload.py
=====================================
@@ -8,7 +8,6 @@
from typing import cast
-import mimetypes
import os
from collections import defaultdict
from collections.abc import Callable
@@ -41,6 +40,7 @@
from gajim.common.modules.base import BaseModule
from gajim.common.structs import OutgoingMessage
from gajim.common.util.http import create_http_request
+from gajim.common.util.preview import guess_mime_type
from gajim.common.util.text import get_random_string
from gajim.common.util.user_strings import get_tls_error_phrases
@@ -144,7 +144,7 @@ def _make_transfer(self,
if invalid_file:
raise FileError(msg)
- mime = mimetypes.MimeTypes().guess_type(path)[0]
+ mime = guess_mime_type(path)
if not mime:
mime = 'application/octet-stream' # fallback mime type
self._log.info('Detected MIME type of file: %s', mime)
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/8ad0d5fdc19ea6be11f8461f23edd45c4c855fd3
--
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/8ad0d5fdc19ea6be11f8461f23edd45c4c855fd3
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]