Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

upload: Show text/plain uploads inline.

Anders Kaseorg84d5ef128548
diff --git a/zerver/lib/upload/base.py b/zerver/lib/upload/base.py
index c869c08ff48..05abde01bf5 100644
--- a/zerver/lib/upload/base.py
+++ b/zerver/lib/upload/base.py
@@ -22,6 +22,7 @@ INLINE_MIME_TYPES = [
"image/jpeg",
"image/png",
"image/webp",
+ "text/plain",
"video/mp4",
"video/webm",
# To avoid cross-site scripting attacks, DO NOT add types such
diff --git a/zerver/tests/test_upload.py b/zerver/tests/test_upload.py
index c1981ea875f..f39dd0f8b1d 100644
--- a/zerver/tests/test_upload.py
+++ b/zerver/tests/test_upload.py
@@ -1005,14 +1005,11 @@ class FileUploadTest(UploadSerializeMixin, ZulipTestCase):
self.assertIn(content_disposition, response["Content-disposition"])
self.assertEqual(set(response["Cache-Control"].split(", ")), {"private", "immutable"})
- check_xsend_links(
- "zulip.txt", "zulip.txt", 'filename="zulip.txt"', returned_attachment=True
- )
+ check_xsend_links("zulip.txt", "zulip.txt", 'filename="zulip.txt"')
check_xsend_links(
"áéБД.txt",
"%C3%A1%C3%A9%D0%91%D0%94.txt",
"filename*=utf-8''%C3%A1%C3%A9%D0%91%D0%94.txt",
- returned_attachment=True,
)
check_xsend_links(
"zulip.html",