JPEG content_type must be image/jpeg
authorMark Felder <feld@FreeBSD.org>
Tue, 13 Oct 2020 15:37:24 +0000 (10:37 -0500)
committerMark Felder <feld@FreeBSD.org>
Tue, 13 Oct 2020 15:37:24 +0000 (10:37 -0500)
24 files changed:
test/pleroma/object_test.exs
test/pleroma/upload/filter/anonymize_filename_test.exs
test/pleroma/upload/filter/dedupe_test.exs
test/pleroma/upload/filter/exiftool_test.exs
test/pleroma/upload/filter/mogrifun_test.exs
test/pleroma/upload/filter/mogrify_test.exs
test/pleroma/upload/filter_test.exs
test/pleroma/upload_test.exs
test/pleroma/uploaders/local_test.exs
test/pleroma/uploaders/s3_test.exs
test/pleroma/web/activity_pub/activity_pub_test.exs
test/pleroma/web/activity_pub/object_validators/attachment_validator_test.exs
test/pleroma/web/activity_pub/object_validators/chat_validation_test.exs
test/pleroma/web/common_api_test.exs
test/pleroma/web/mastodon_api/controllers/account_controller_test.exs
test/pleroma/web/mastodon_api/controllers/media_controller_test.exs
test/pleroma/web/mastodon_api/controllers/status_controller_test.exs
test/pleroma/web/mastodon_api/update_credentials_test.exs
test/pleroma/web/mastodon_api/views/scheduled_activity_view_test.exs
test/pleroma/web/pleroma_api/controllers/chat_controller_test.exs
test/pleroma/web/pleroma_api/controllers/mascot_controller_test.exs
test/pleroma/web/pleroma_api/views/chat_message_reference_view_test.exs
test/pleroma/web/plugs/uploaded_media_plug_test.exs
test/pleroma/web/push/impl_test.exs

index 198d3b1cf1ac969016e0ca5effc2f0000ee9210b..99caba3369ef289d979c46bb22fe77c7b7e88adb 100644 (file)
@@ -82,7 +82,7 @@ defmodule Pleroma.ObjectTest do
       Pleroma.Config.put([:instance, :cleanup_attachments], false)
 
       file = %Plug.Upload{
-        content_type: "image/jpg",
+        content_type: "image/jpeg",
         path: Path.absname("test/fixtures/image.jpg"),
         filename: "an_image.jpg"
       }
@@ -116,7 +116,7 @@ defmodule Pleroma.ObjectTest do
       Pleroma.Config.put([:instance, :cleanup_attachments], true)
 
       file = %Plug.Upload{
-        content_type: "image/jpg",
+        content_type: "image/jpeg",
         path: Path.absname("test/fixtures/image.jpg"),
         filename: "an_image.jpg"
       }
@@ -155,7 +155,7 @@ defmodule Pleroma.ObjectTest do
       File.mkdir_p!(uploads_dir)
 
       file = %Plug.Upload{
-        content_type: "image/jpg",
+        content_type: "image/jpeg",
         path: Path.absname("test/fixtures/image.jpg"),
         filename: "an_image.jpg"
       }
@@ -188,7 +188,7 @@ defmodule Pleroma.ObjectTest do
       Pleroma.Config.put([:instance, :cleanup_attachments], true)
 
       file = %Plug.Upload{
-        content_type: "image/jpg",
+        content_type: "image/jpeg",
         path: Path.absname("test/fixtures/image.jpg"),
         filename: "an_image.jpg"
       }
@@ -225,7 +225,7 @@ defmodule Pleroma.ObjectTest do
       Pleroma.Config.put([:instance, :cleanup_attachments], true)
 
       file = %Plug.Upload{
-        content_type: "image/jpg",
+        content_type: "image/jpeg",
         path: Path.absname("test/fixtures/image.jpg"),
         filename: "an_image.jpg"
       }
index 19b915cc80dc0bca750203fe08e9dbb19effc8b7..7ef01ce9106ec7f010dc9eec6c4784e656d6e90b 100644 (file)
@@ -13,7 +13,7 @@ defmodule Pleroma.Upload.Filter.AnonymizeFilenameTest do
 
     upload_file = %Upload{
       name: "an… image.jpg",
-      content_type: "image/jpg",
+      content_type: "image/jpeg",
       path: Path.absname("test/fixtures/image_tmp.jpg")
     }
 
index 75c7198e1bf3e8970f56e5dc929535a1e5971b89..92a3d7df32e8175cff045d46f876a67d09673749 100644 (file)
@@ -18,7 +18,7 @@ defmodule Pleroma.Upload.Filter.DedupeTest do
 
     upload = %Upload{
       name: "an… image.jpg",
-      content_type: "image/jpg",
+      content_type: "image/jpeg",
       path: Path.absname("test/fixtures/image_tmp.jpg"),
       tempfile: Path.absname("test/fixtures/image_tmp.jpg")
     }
index d4cd4ba1145eb2e50f996bb41d60196972522159..6b978b64cbf69a8a8d4941cc62c276d31ba1b4d0 100644 (file)
@@ -16,7 +16,7 @@ defmodule Pleroma.Upload.Filter.ExiftoolTest do
 
     upload = %Pleroma.Upload{
       name: "image_with_GPS_data.jpg",
-      content_type: "image/jpg",
+      content_type: "image/jpeg",
       path: Path.absname("test/fixtures/DSCN0010.jpg"),
       tempfile: Path.absname("test/fixtures/DSCN0010_tmp.jpg")
     }
index dc1e9e78f0f898983bf5886d837db25e96a5cdbf..fc2f6827611795ba41c12cb69da9ec9f2f8878b1 100644 (file)
@@ -17,7 +17,7 @@ defmodule Pleroma.Upload.Filter.MogrifunTest do
 
     upload = %Upload{
       name: "an… image.jpg",
-      content_type: "image/jpg",
+      content_type: "image/jpeg",
       path: Path.absname("test/fixtures/image_tmp.jpg"),
       tempfile: Path.absname("test/fixtures/image_tmp.jpg")
     }
index bf64b96b365697df9e6544867da50f33345eed9f..6dee02e8bd15f312c5555d8d35fa5f6cff472df6 100644 (file)
@@ -18,7 +18,7 @@ defmodule Pleroma.Upload.Filter.MogrifyTest do
 
     upload = %Pleroma.Upload{
       name: "an… image.jpg",
-      content_type: "image/jpg",
+      content_type: "image/jpeg",
       path: Path.absname("test/fixtures/image_tmp.jpg"),
       tempfile: Path.absname("test/fixtures/image_tmp.jpg")
     }
index 352b664024ed68e94a0f3477b3b37e04d55da685..09394929ca94551c0bc3e24558a9dfa0dd1a3ce5 100644 (file)
@@ -20,7 +20,7 @@ defmodule Pleroma.Upload.FilterTest do
 
     upload = %Pleroma.Upload{
       name: "an… image.jpg",
-      content_type: "image/jpg",
+      content_type: "image/jpeg",
       path: Path.absname("test/fixtures/image_tmp.jpg"),
       tempfile: Path.absname("test/fixtures/image_tmp.jpg")
     }
index 4280bfcacca7147e4b05d3ef551c448346d8ebdc..f52d4dff6d4306aaaf71fa5618b533e1c109d6cf 100644 (file)
@@ -112,7 +112,7 @@ defmodule Pleroma.UploadTest do
       File.cp!("test/fixtures/image.jpg", "test/fixtures/image_tmp.jpg")
 
       file = %Plug.Upload{
-        content_type: "image/jpg",
+        content_type: "image/jpeg",
         path: Path.absname("test/fixtures/image_tmp.jpg"),
         filename: "image.jpg"
       }
index 18122ff6c372c98c74230dcfb9790d0178bfd92e..1ce7be485607ef3ef723a4bf7fc90cdd3f408ed6 100644 (file)
@@ -19,7 +19,7 @@ defmodule Pleroma.Uploaders.LocalTest do
 
       file = %Pleroma.Upload{
         name: "image.jpg",
-        content_type: "image/jpg",
+        content_type: "image/jpeg",
         path: file_path,
         tempfile: Path.absname("test/fixtures/image_tmp.jpg")
       }
@@ -38,7 +38,7 @@ defmodule Pleroma.Uploaders.LocalTest do
 
       file = %Pleroma.Upload{
         name: "image.jpg",
-        content_type: "image/jpg",
+        content_type: "image/jpeg",
         path: file_path,
         tempfile: Path.absname("test/fixtures/image_tmp.jpg")
       }
index d949c90a5c2ce183fb0a8d869a4f4edee1891ca4..e7a013dd8e843311fd34447cdea762ac454be54a 100644 (file)
@@ -56,7 +56,7 @@ defmodule Pleroma.Uploaders.S3Test do
     setup do
       file_upload = %Pleroma.Upload{
         name: "image-tet.jpg",
-        content_type: "image/jpg",
+        content_type: "image/jpeg",
         path: "test_folder/image-tet.jpg",
         tempfile: Path.absname("test/instance_static/add/shortcode.png")
       }
index 804305a1381321e35c4ae38dcc8d67febcecf5de..8f53d059939d8d655dff4770fd7bb5527035f8e0 100644 (file)
@@ -1029,7 +1029,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
   describe "uploading files" do
     setup do
       test_file = %Plug.Upload{
-        content_type: "image/jpg",
+        content_type: "image/jpeg",
         path: Path.absname("test/fixtures/image.jpg"),
         filename: "an_image.jpg"
       }
index 558bb3131c048af523c298f47e7529dc48a5a0d4..760388e802434261813b56319b864552686be23d 100644 (file)
@@ -56,7 +56,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.AttachmentValidatorTest do
       user = insert(:user)
 
       file = %Plug.Upload{
-        content_type: "image/jpg",
+        content_type: "image/jpeg",
         path: Path.absname("test/fixtures/image.jpg"),
         filename: "an_image.jpg"
       }
index 16e4808e59708e415dba4ec59ffe8807befdae1b..d7e29922443163b0e5c4d1031e302f4e4f49c26a 100644 (file)
@@ -77,7 +77,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.ChatValidationTest do
       user: user
     } do
       file = %Plug.Upload{
-        content_type: "image/jpg",
+        content_type: "image/jpeg",
         path: Path.absname("test/fixtures/image.jpg"),
         filename: "an_image.jpg"
       }
@@ -98,7 +98,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.ChatValidationTest do
       user: user
     } do
       file = %Plug.Upload{
-        content_type: "image/jpg",
+        content_type: "image/jpeg",
         path: Path.absname("test/fixtures/image.jpg"),
         filename: "an_image.jpg"
       }
@@ -119,7 +119,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.ChatValidationTest do
       user: user
     } do
       file = %Plug.Upload{
-        content_type: "image/jpg",
+        content_type: "image/jpeg",
         path: Path.absname("test/fixtures/image.jpg"),
         filename: "an_image.jpg"
       }
index e34f5a49b39b8ae7f29ba6c03ac66cb503497b80..d19d484b78471f9cf94b940b23476f27c52cf7ee 100644 (file)
@@ -100,7 +100,7 @@ defmodule Pleroma.Web.CommonAPITest do
       recipient = insert(:user)
 
       file = %Plug.Upload{
-        content_type: "image/jpg",
+        content_type: "image/jpeg",
         path: Path.absname("test/fixtures/image.jpg"),
         filename: "an_image.jpg"
       }
index f7f1369e48e35d70a19d925a2a3c2d2f66a05b00..4ef404541082280d0ad642e1d42c98266e4d9b5a 100644 (file)
@@ -380,7 +380,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
       other_user = insert(:user)
 
       file = %Plug.Upload{
-        content_type: "image/jpg",
+        content_type: "image/jpeg",
         path: Path.absname("test/fixtures/image.jpg"),
         filename: "an_image.jpg"
       }
index 906fd940f7c1c6ad09f8359d58c8ad915278d391..d2bd57515bb84e08e53939e7a7d5bbd1e589d373 100644 (file)
@@ -14,7 +14,7 @@ defmodule Pleroma.Web.MastodonAPI.MediaControllerTest do
 
     setup do
       image = %Plug.Upload{
-        content_type: "image/jpg",
+        content_type: "image/jpeg",
         path: Path.absname("test/fixtures/image.jpg"),
         filename: "an_image.jpg"
       }
@@ -74,7 +74,7 @@ defmodule Pleroma.Web.MastodonAPI.MediaControllerTest do
 
     setup %{user: actor} do
       file = %Plug.Upload{
-        content_type: "image/jpg",
+        content_type: "image/jpeg",
         path: Path.absname("test/fixtures/image.jpg"),
         filename: "an_image.jpg"
       }
@@ -106,7 +106,7 @@ defmodule Pleroma.Web.MastodonAPI.MediaControllerTest do
 
     setup %{user: actor} do
       file = %Plug.Upload{
-        content_type: "image/jpg",
+        content_type: "image/jpeg",
         path: Path.absname("test/fixtures/image.jpg"),
         filename: "an_image.jpg"
       }
index 633a25e506b1ee3cdf779bcf81d8423956966424..61359214a1085001d9dc4152c1e78d0208aab6ae 100644 (file)
@@ -167,7 +167,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
 
     test "posting an undefined status with an attachment", %{user: user, conn: conn} do
       file = %Plug.Upload{
-        content_type: "image/jpg",
+        content_type: "image/jpeg",
         path: Path.absname("test/fixtures/image.jpg"),
         filename: "an_image.jpg"
       }
@@ -408,7 +408,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
         |> Kernel.<>("Z")
 
       file = %Plug.Upload{
-        content_type: "image/jpg",
+        content_type: "image/jpeg",
         path: Path.absname("test/fixtures/image.jpg"),
         filename: "an_image.jpg"
       }
index fe462caa38c07739e182c264093c2ab774280c51..ed1921c9145d2b503b6a1c7160bdab4cbba89961 100644 (file)
@@ -222,7 +222,7 @@ defmodule Pleroma.Web.MastodonAPI.UpdateCredentialsTest do
 
     test "updates the user's avatar", %{user: user, conn: conn} do
       new_avatar = %Plug.Upload{
-        content_type: "image/jpg",
+        content_type: "image/jpeg",
         path: Path.absname("test/fixtures/image.jpg"),
         filename: "an_image.jpg"
       }
@@ -246,7 +246,7 @@ defmodule Pleroma.Web.MastodonAPI.UpdateCredentialsTest do
 
     test "updates the user's banner", %{user: user, conn: conn} do
       new_header = %Plug.Upload{
-        content_type: "image/jpg",
+        content_type: "image/jpeg",
         path: Path.absname("test/fixtures/image.jpg"),
         filename: "an_image.jpg"
       }
@@ -265,7 +265,7 @@ defmodule Pleroma.Web.MastodonAPI.UpdateCredentialsTest do
 
     test "updates the user's background", %{conn: conn, user: user} do
       new_header = %Plug.Upload{
-        content_type: "image/jpg",
+        content_type: "image/jpeg",
         path: Path.absname("test/fixtures/image.jpg"),
         filename: "an_image.jpg"
       }
index fbfd873effc817ef0dca6ff9173e5b3a1cb41349..04f73f5a015aff6e56d6f37a63225786cd4cef38 100644 (file)
@@ -22,7 +22,7 @@ defmodule Pleroma.Web.MastodonAPI.ScheduledActivityViewTest do
       |> NaiveDateTime.to_iso8601()
 
     file = %Plug.Upload{
-      content_type: "image/jpg",
+      content_type: "image/jpeg",
       path: Path.absname("test/fixtures/image.jpg"),
       filename: "an_image.jpg"
     }
index 11d5ba3739def5970ba9875dcd7658ac9b1ba3bf..6381f9757e5f33ff429d51aa7dc8e38754f0c1a9 100644 (file)
@@ -105,7 +105,7 @@ defmodule Pleroma.Web.PleromaAPI.ChatControllerTest do
 
     test "it works with an attachment", %{conn: conn, user: user} do
       file = %Plug.Upload{
-        content_type: "image/jpg",
+        content_type: "image/jpeg",
         path: Path.absname("test/fixtures/image.jpg"),
         filename: "an_image.jpg"
       }
index e2ead6e154e85c77b215e069984f67a62c2d75e1..d6be92869a85f2e1f268e9793edbb809dbe494be 100644 (file)
@@ -24,7 +24,7 @@ defmodule Pleroma.Web.PleromaAPI.MascotControllerTest do
     assert json_response_and_validate_schema(ret_conn, 415)
 
     file = %Plug.Upload{
-      content_type: "image/jpg",
+      content_type: "image/jpeg",
       path: Path.absname("test/fixtures/image.jpg"),
       filename: "an_image.jpg"
     }
@@ -48,7 +48,7 @@ defmodule Pleroma.Web.PleromaAPI.MascotControllerTest do
 
     # When a user sets their mascot, we should get that back
     file = %Plug.Upload{
-      content_type: "image/jpg",
+      content_type: "image/jpeg",
       path: Path.absname("test/fixtures/image.jpg"),
       filename: "an_image.jpg"
     }
index 26272c12513ffefeb363b0b8725fc631ef220971..f171a1e55be4e5df38376e5703c85637c87a687c 100644 (file)
@@ -19,7 +19,7 @@ defmodule Pleroma.Web.PleromaAPI.ChatMessageReferenceViewTest do
     recipient = insert(:user)
 
     file = %Plug.Upload{
-      content_type: "image/jpg",
+      content_type: "image/jpeg",
       path: Path.absname("test/fixtures/image.jpg"),
       filename: "an_image.jpg"
     }
index 07f52c8cd0b3195aa4a9e645fb2b4dc9411ee0da..7c83131212dda896e286c7f8be4259ce47fdd893 100644 (file)
@@ -11,7 +11,7 @@ defmodule Pleroma.Web.Plugs.UploadedMediaPlugTest do
     File.cp!("test/fixtures/image.jpg", "test/fixtures/image_tmp.jpg")
 
     file = %Plug.Upload{
-      content_type: "image/jpg",
+      content_type: "image/jpeg",
       path: Path.absname("test/fixtures/image_tmp.jpg"),
       filename: "nice_tf.jpg"
     }
index 6cab46696dede96a40a9a4a618f0834ec3892968..7d8cc999a9035faff4fb93977763650778a1cec8 100644 (file)
@@ -219,7 +219,7 @@ defmodule Pleroma.Web.Push.ImplTest do
       recipient = insert(:user)
 
       file = %Plug.Upload{
-        content_type: "image/jpg",
+        content_type: "image/jpeg",
         path: Path.absname("test/fixtures/image.jpg"),
         filename: "an_image.jpg"
       }