JPEG content_type must be image/jpeg
This commit is contained in:
parent
b738f70953
commit
40f3cdc030
@ -82,7 +82,7 @@ defmodule Pleroma.ObjectTest do
|
|||||||
Pleroma.Config.put([:instance, :cleanup_attachments], false)
|
Pleroma.Config.put([:instance, :cleanup_attachments], false)
|
||||||
|
|
||||||
file = %Plug.Upload{
|
file = %Plug.Upload{
|
||||||
content_type: "image/jpg",
|
content_type: "image/jpeg",
|
||||||
path: Path.absname("test/fixtures/image.jpg"),
|
path: Path.absname("test/fixtures/image.jpg"),
|
||||||
filename: "an_image.jpg"
|
filename: "an_image.jpg"
|
||||||
}
|
}
|
||||||
@ -116,7 +116,7 @@ defmodule Pleroma.ObjectTest do
|
|||||||
Pleroma.Config.put([:instance, :cleanup_attachments], true)
|
Pleroma.Config.put([:instance, :cleanup_attachments], true)
|
||||||
|
|
||||||
file = %Plug.Upload{
|
file = %Plug.Upload{
|
||||||
content_type: "image/jpg",
|
content_type: "image/jpeg",
|
||||||
path: Path.absname("test/fixtures/image.jpg"),
|
path: Path.absname("test/fixtures/image.jpg"),
|
||||||
filename: "an_image.jpg"
|
filename: "an_image.jpg"
|
||||||
}
|
}
|
||||||
@ -155,7 +155,7 @@ defmodule Pleroma.ObjectTest do
|
|||||||
File.mkdir_p!(uploads_dir)
|
File.mkdir_p!(uploads_dir)
|
||||||
|
|
||||||
file = %Plug.Upload{
|
file = %Plug.Upload{
|
||||||
content_type: "image/jpg",
|
content_type: "image/jpeg",
|
||||||
path: Path.absname("test/fixtures/image.jpg"),
|
path: Path.absname("test/fixtures/image.jpg"),
|
||||||
filename: "an_image.jpg"
|
filename: "an_image.jpg"
|
||||||
}
|
}
|
||||||
@ -188,7 +188,7 @@ defmodule Pleroma.ObjectTest do
|
|||||||
Pleroma.Config.put([:instance, :cleanup_attachments], true)
|
Pleroma.Config.put([:instance, :cleanup_attachments], true)
|
||||||
|
|
||||||
file = %Plug.Upload{
|
file = %Plug.Upload{
|
||||||
content_type: "image/jpg",
|
content_type: "image/jpeg",
|
||||||
path: Path.absname("test/fixtures/image.jpg"),
|
path: Path.absname("test/fixtures/image.jpg"),
|
||||||
filename: "an_image.jpg"
|
filename: "an_image.jpg"
|
||||||
}
|
}
|
||||||
@ -225,7 +225,7 @@ defmodule Pleroma.ObjectTest do
|
|||||||
Pleroma.Config.put([:instance, :cleanup_attachments], true)
|
Pleroma.Config.put([:instance, :cleanup_attachments], true)
|
||||||
|
|
||||||
file = %Plug.Upload{
|
file = %Plug.Upload{
|
||||||
content_type: "image/jpg",
|
content_type: "image/jpeg",
|
||||||
path: Path.absname("test/fixtures/image.jpg"),
|
path: Path.absname("test/fixtures/image.jpg"),
|
||||||
filename: "an_image.jpg"
|
filename: "an_image.jpg"
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ defmodule Pleroma.Upload.Filter.AnonymizeFilenameTest do
|
|||||||
|
|
||||||
upload_file = %Upload{
|
upload_file = %Upload{
|
||||||
name: "an… image.jpg",
|
name: "an… image.jpg",
|
||||||
content_type: "image/jpg",
|
content_type: "image/jpeg",
|
||||||
path: Path.absname("test/fixtures/image_tmp.jpg")
|
path: Path.absname("test/fixtures/image_tmp.jpg")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ defmodule Pleroma.Upload.Filter.DedupeTest do
|
|||||||
|
|
||||||
upload = %Upload{
|
upload = %Upload{
|
||||||
name: "an… image.jpg",
|
name: "an… image.jpg",
|
||||||
content_type: "image/jpg",
|
content_type: "image/jpeg",
|
||||||
path: Path.absname("test/fixtures/image_tmp.jpg"),
|
path: Path.absname("test/fixtures/image_tmp.jpg"),
|
||||||
tempfile: Path.absname("test/fixtures/image_tmp.jpg")
|
tempfile: Path.absname("test/fixtures/image_tmp.jpg")
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ defmodule Pleroma.Upload.Filter.ExiftoolTest do
|
|||||||
|
|
||||||
upload = %Pleroma.Upload{
|
upload = %Pleroma.Upload{
|
||||||
name: "image_with_GPS_data.jpg",
|
name: "image_with_GPS_data.jpg",
|
||||||
content_type: "image/jpg",
|
content_type: "image/jpeg",
|
||||||
path: Path.absname("test/fixtures/DSCN0010.jpg"),
|
path: Path.absname("test/fixtures/DSCN0010.jpg"),
|
||||||
tempfile: Path.absname("test/fixtures/DSCN0010_tmp.jpg")
|
tempfile: Path.absname("test/fixtures/DSCN0010_tmp.jpg")
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ defmodule Pleroma.Upload.Filter.MogrifunTest do
|
|||||||
|
|
||||||
upload = %Upload{
|
upload = %Upload{
|
||||||
name: "an… image.jpg",
|
name: "an… image.jpg",
|
||||||
content_type: "image/jpg",
|
content_type: "image/jpeg",
|
||||||
path: Path.absname("test/fixtures/image_tmp.jpg"),
|
path: Path.absname("test/fixtures/image_tmp.jpg"),
|
||||||
tempfile: Path.absname("test/fixtures/image_tmp.jpg")
|
tempfile: Path.absname("test/fixtures/image_tmp.jpg")
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ defmodule Pleroma.Upload.Filter.MogrifyTest do
|
|||||||
|
|
||||||
upload = %Pleroma.Upload{
|
upload = %Pleroma.Upload{
|
||||||
name: "an… image.jpg",
|
name: "an… image.jpg",
|
||||||
content_type: "image/jpg",
|
content_type: "image/jpeg",
|
||||||
path: Path.absname("test/fixtures/image_tmp.jpg"),
|
path: Path.absname("test/fixtures/image_tmp.jpg"),
|
||||||
tempfile: Path.absname("test/fixtures/image_tmp.jpg")
|
tempfile: Path.absname("test/fixtures/image_tmp.jpg")
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ defmodule Pleroma.Upload.FilterTest do
|
|||||||
|
|
||||||
upload = %Pleroma.Upload{
|
upload = %Pleroma.Upload{
|
||||||
name: "an… image.jpg",
|
name: "an… image.jpg",
|
||||||
content_type: "image/jpg",
|
content_type: "image/jpeg",
|
||||||
path: Path.absname("test/fixtures/image_tmp.jpg"),
|
path: Path.absname("test/fixtures/image_tmp.jpg"),
|
||||||
tempfile: Path.absname("test/fixtures/image_tmp.jpg")
|
tempfile: Path.absname("test/fixtures/image_tmp.jpg")
|
||||||
}
|
}
|
||||||
|
@ -112,7 +112,7 @@ defmodule Pleroma.UploadTest do
|
|||||||
File.cp!("test/fixtures/image.jpg", "test/fixtures/image_tmp.jpg")
|
File.cp!("test/fixtures/image.jpg", "test/fixtures/image_tmp.jpg")
|
||||||
|
|
||||||
file = %Plug.Upload{
|
file = %Plug.Upload{
|
||||||
content_type: "image/jpg",
|
content_type: "image/jpeg",
|
||||||
path: Path.absname("test/fixtures/image_tmp.jpg"),
|
path: Path.absname("test/fixtures/image_tmp.jpg"),
|
||||||
filename: "image.jpg"
|
filename: "image.jpg"
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ defmodule Pleroma.Uploaders.LocalTest do
|
|||||||
|
|
||||||
file = %Pleroma.Upload{
|
file = %Pleroma.Upload{
|
||||||
name: "image.jpg",
|
name: "image.jpg",
|
||||||
content_type: "image/jpg",
|
content_type: "image/jpeg",
|
||||||
path: file_path,
|
path: file_path,
|
||||||
tempfile: Path.absname("test/fixtures/image_tmp.jpg")
|
tempfile: Path.absname("test/fixtures/image_tmp.jpg")
|
||||||
}
|
}
|
||||||
@ -38,7 +38,7 @@ defmodule Pleroma.Uploaders.LocalTest do
|
|||||||
|
|
||||||
file = %Pleroma.Upload{
|
file = %Pleroma.Upload{
|
||||||
name: "image.jpg",
|
name: "image.jpg",
|
||||||
content_type: "image/jpg",
|
content_type: "image/jpeg",
|
||||||
path: file_path,
|
path: file_path,
|
||||||
tempfile: Path.absname("test/fixtures/image_tmp.jpg")
|
tempfile: Path.absname("test/fixtures/image_tmp.jpg")
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ defmodule Pleroma.Uploaders.S3Test do
|
|||||||
setup do
|
setup do
|
||||||
file_upload = %Pleroma.Upload{
|
file_upload = %Pleroma.Upload{
|
||||||
name: "image-tet.jpg",
|
name: "image-tet.jpg",
|
||||||
content_type: "image/jpg",
|
content_type: "image/jpeg",
|
||||||
path: "test_folder/image-tet.jpg",
|
path: "test_folder/image-tet.jpg",
|
||||||
tempfile: Path.absname("test/instance_static/add/shortcode.png")
|
tempfile: Path.absname("test/instance_static/add/shortcode.png")
|
||||||
}
|
}
|
||||||
|
@ -1029,7 +1029,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
|
|||||||
describe "uploading files" do
|
describe "uploading files" do
|
||||||
setup do
|
setup do
|
||||||
test_file = %Plug.Upload{
|
test_file = %Plug.Upload{
|
||||||
content_type: "image/jpg",
|
content_type: "image/jpeg",
|
||||||
path: Path.absname("test/fixtures/image.jpg"),
|
path: Path.absname("test/fixtures/image.jpg"),
|
||||||
filename: "an_image.jpg"
|
filename: "an_image.jpg"
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.AttachmentValidatorTest do
|
|||||||
user = insert(:user)
|
user = insert(:user)
|
||||||
|
|
||||||
file = %Plug.Upload{
|
file = %Plug.Upload{
|
||||||
content_type: "image/jpg",
|
content_type: "image/jpeg",
|
||||||
path: Path.absname("test/fixtures/image.jpg"),
|
path: Path.absname("test/fixtures/image.jpg"),
|
||||||
filename: "an_image.jpg"
|
filename: "an_image.jpg"
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.ChatValidationTest do
|
|||||||
user: user
|
user: user
|
||||||
} do
|
} do
|
||||||
file = %Plug.Upload{
|
file = %Plug.Upload{
|
||||||
content_type: "image/jpg",
|
content_type: "image/jpeg",
|
||||||
path: Path.absname("test/fixtures/image.jpg"),
|
path: Path.absname("test/fixtures/image.jpg"),
|
||||||
filename: "an_image.jpg"
|
filename: "an_image.jpg"
|
||||||
}
|
}
|
||||||
@ -98,7 +98,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.ChatValidationTest do
|
|||||||
user: user
|
user: user
|
||||||
} do
|
} do
|
||||||
file = %Plug.Upload{
|
file = %Plug.Upload{
|
||||||
content_type: "image/jpg",
|
content_type: "image/jpeg",
|
||||||
path: Path.absname("test/fixtures/image.jpg"),
|
path: Path.absname("test/fixtures/image.jpg"),
|
||||||
filename: "an_image.jpg"
|
filename: "an_image.jpg"
|
||||||
}
|
}
|
||||||
@ -119,7 +119,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.ChatValidationTest do
|
|||||||
user: user
|
user: user
|
||||||
} do
|
} do
|
||||||
file = %Plug.Upload{
|
file = %Plug.Upload{
|
||||||
content_type: "image/jpg",
|
content_type: "image/jpeg",
|
||||||
path: Path.absname("test/fixtures/image.jpg"),
|
path: Path.absname("test/fixtures/image.jpg"),
|
||||||
filename: "an_image.jpg"
|
filename: "an_image.jpg"
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,7 @@ defmodule Pleroma.Web.CommonAPITest do
|
|||||||
recipient = insert(:user)
|
recipient = insert(:user)
|
||||||
|
|
||||||
file = %Plug.Upload{
|
file = %Plug.Upload{
|
||||||
content_type: "image/jpg",
|
content_type: "image/jpeg",
|
||||||
path: Path.absname("test/fixtures/image.jpg"),
|
path: Path.absname("test/fixtures/image.jpg"),
|
||||||
filename: "an_image.jpg"
|
filename: "an_image.jpg"
|
||||||
}
|
}
|
||||||
|
@ -380,7 +380,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
|
|||||||
other_user = insert(:user)
|
other_user = insert(:user)
|
||||||
|
|
||||||
file = %Plug.Upload{
|
file = %Plug.Upload{
|
||||||
content_type: "image/jpg",
|
content_type: "image/jpeg",
|
||||||
path: Path.absname("test/fixtures/image.jpg"),
|
path: Path.absname("test/fixtures/image.jpg"),
|
||||||
filename: "an_image.jpg"
|
filename: "an_image.jpg"
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ defmodule Pleroma.Web.MastodonAPI.MediaControllerTest do
|
|||||||
|
|
||||||
setup do
|
setup do
|
||||||
image = %Plug.Upload{
|
image = %Plug.Upload{
|
||||||
content_type: "image/jpg",
|
content_type: "image/jpeg",
|
||||||
path: Path.absname("test/fixtures/image.jpg"),
|
path: Path.absname("test/fixtures/image.jpg"),
|
||||||
filename: "an_image.jpg"
|
filename: "an_image.jpg"
|
||||||
}
|
}
|
||||||
@ -74,7 +74,7 @@ defmodule Pleroma.Web.MastodonAPI.MediaControllerTest do
|
|||||||
|
|
||||||
setup %{user: actor} do
|
setup %{user: actor} do
|
||||||
file = %Plug.Upload{
|
file = %Plug.Upload{
|
||||||
content_type: "image/jpg",
|
content_type: "image/jpeg",
|
||||||
path: Path.absname("test/fixtures/image.jpg"),
|
path: Path.absname("test/fixtures/image.jpg"),
|
||||||
filename: "an_image.jpg"
|
filename: "an_image.jpg"
|
||||||
}
|
}
|
||||||
@ -106,7 +106,7 @@ defmodule Pleroma.Web.MastodonAPI.MediaControllerTest do
|
|||||||
|
|
||||||
setup %{user: actor} do
|
setup %{user: actor} do
|
||||||
file = %Plug.Upload{
|
file = %Plug.Upload{
|
||||||
content_type: "image/jpg",
|
content_type: "image/jpeg",
|
||||||
path: Path.absname("test/fixtures/image.jpg"),
|
path: Path.absname("test/fixtures/image.jpg"),
|
||||||
filename: "an_image.jpg"
|
filename: "an_image.jpg"
|
||||||
}
|
}
|
||||||
|
@ -167,7 +167,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
|
|||||||
|
|
||||||
test "posting an undefined status with an attachment", %{user: user, conn: conn} do
|
test "posting an undefined status with an attachment", %{user: user, conn: conn} do
|
||||||
file = %Plug.Upload{
|
file = %Plug.Upload{
|
||||||
content_type: "image/jpg",
|
content_type: "image/jpeg",
|
||||||
path: Path.absname("test/fixtures/image.jpg"),
|
path: Path.absname("test/fixtures/image.jpg"),
|
||||||
filename: "an_image.jpg"
|
filename: "an_image.jpg"
|
||||||
}
|
}
|
||||||
@ -408,7 +408,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
|
|||||||
|> Kernel.<>("Z")
|
|> Kernel.<>("Z")
|
||||||
|
|
||||||
file = %Plug.Upload{
|
file = %Plug.Upload{
|
||||||
content_type: "image/jpg",
|
content_type: "image/jpeg",
|
||||||
path: Path.absname("test/fixtures/image.jpg"),
|
path: Path.absname("test/fixtures/image.jpg"),
|
||||||
filename: "an_image.jpg"
|
filename: "an_image.jpg"
|
||||||
}
|
}
|
||||||
|
@ -222,7 +222,7 @@ defmodule Pleroma.Web.MastodonAPI.UpdateCredentialsTest do
|
|||||||
|
|
||||||
test "updates the user's avatar", %{user: user, conn: conn} do
|
test "updates the user's avatar", %{user: user, conn: conn} do
|
||||||
new_avatar = %Plug.Upload{
|
new_avatar = %Plug.Upload{
|
||||||
content_type: "image/jpg",
|
content_type: "image/jpeg",
|
||||||
path: Path.absname("test/fixtures/image.jpg"),
|
path: Path.absname("test/fixtures/image.jpg"),
|
||||||
filename: "an_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
|
test "updates the user's banner", %{user: user, conn: conn} do
|
||||||
new_header = %Plug.Upload{
|
new_header = %Plug.Upload{
|
||||||
content_type: "image/jpg",
|
content_type: "image/jpeg",
|
||||||
path: Path.absname("test/fixtures/image.jpg"),
|
path: Path.absname("test/fixtures/image.jpg"),
|
||||||
filename: "an_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
|
test "updates the user's background", %{conn: conn, user: user} do
|
||||||
new_header = %Plug.Upload{
|
new_header = %Plug.Upload{
|
||||||
content_type: "image/jpg",
|
content_type: "image/jpeg",
|
||||||
path: Path.absname("test/fixtures/image.jpg"),
|
path: Path.absname("test/fixtures/image.jpg"),
|
||||||
filename: "an_image.jpg"
|
filename: "an_image.jpg"
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ defmodule Pleroma.Web.MastodonAPI.ScheduledActivityViewTest do
|
|||||||
|> NaiveDateTime.to_iso8601()
|
|> NaiveDateTime.to_iso8601()
|
||||||
|
|
||||||
file = %Plug.Upload{
|
file = %Plug.Upload{
|
||||||
content_type: "image/jpg",
|
content_type: "image/jpeg",
|
||||||
path: Path.absname("test/fixtures/image.jpg"),
|
path: Path.absname("test/fixtures/image.jpg"),
|
||||||
filename: "an_image.jpg"
|
filename: "an_image.jpg"
|
||||||
}
|
}
|
||||||
|
@ -105,7 +105,7 @@ defmodule Pleroma.Web.PleromaAPI.ChatControllerTest do
|
|||||||
|
|
||||||
test "it works with an attachment", %{conn: conn, user: user} do
|
test "it works with an attachment", %{conn: conn, user: user} do
|
||||||
file = %Plug.Upload{
|
file = %Plug.Upload{
|
||||||
content_type: "image/jpg",
|
content_type: "image/jpeg",
|
||||||
path: Path.absname("test/fixtures/image.jpg"),
|
path: Path.absname("test/fixtures/image.jpg"),
|
||||||
filename: "an_image.jpg"
|
filename: "an_image.jpg"
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ defmodule Pleroma.Web.PleromaAPI.MascotControllerTest do
|
|||||||
assert json_response_and_validate_schema(ret_conn, 415)
|
assert json_response_and_validate_schema(ret_conn, 415)
|
||||||
|
|
||||||
file = %Plug.Upload{
|
file = %Plug.Upload{
|
||||||
content_type: "image/jpg",
|
content_type: "image/jpeg",
|
||||||
path: Path.absname("test/fixtures/image.jpg"),
|
path: Path.absname("test/fixtures/image.jpg"),
|
||||||
filename: "an_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
|
# When a user sets their mascot, we should get that back
|
||||||
file = %Plug.Upload{
|
file = %Plug.Upload{
|
||||||
content_type: "image/jpg",
|
content_type: "image/jpeg",
|
||||||
path: Path.absname("test/fixtures/image.jpg"),
|
path: Path.absname("test/fixtures/image.jpg"),
|
||||||
filename: "an_image.jpg"
|
filename: "an_image.jpg"
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ defmodule Pleroma.Web.PleromaAPI.ChatMessageReferenceViewTest do
|
|||||||
recipient = insert(:user)
|
recipient = insert(:user)
|
||||||
|
|
||||||
file = %Plug.Upload{
|
file = %Plug.Upload{
|
||||||
content_type: "image/jpg",
|
content_type: "image/jpeg",
|
||||||
path: Path.absname("test/fixtures/image.jpg"),
|
path: Path.absname("test/fixtures/image.jpg"),
|
||||||
filename: "an_image.jpg"
|
filename: "an_image.jpg"
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ defmodule Pleroma.Web.Plugs.UploadedMediaPlugTest do
|
|||||||
File.cp!("test/fixtures/image.jpg", "test/fixtures/image_tmp.jpg")
|
File.cp!("test/fixtures/image.jpg", "test/fixtures/image_tmp.jpg")
|
||||||
|
|
||||||
file = %Plug.Upload{
|
file = %Plug.Upload{
|
||||||
content_type: "image/jpg",
|
content_type: "image/jpeg",
|
||||||
path: Path.absname("test/fixtures/image_tmp.jpg"),
|
path: Path.absname("test/fixtures/image_tmp.jpg"),
|
||||||
filename: "nice_tf.jpg"
|
filename: "nice_tf.jpg"
|
||||||
}
|
}
|
||||||
|
@ -219,7 +219,7 @@ defmodule Pleroma.Web.Push.ImplTest do
|
|||||||
recipient = insert(:user)
|
recipient = insert(:user)
|
||||||
|
|
||||||
file = %Plug.Upload{
|
file = %Plug.Upload{
|
||||||
content_type: "image/jpg",
|
content_type: "image/jpeg",
|
||||||
path: Path.absname("test/fixtures/image.jpg"),
|
path: Path.absname("test/fixtures/image.jpg"),
|
||||||
filename: "an_image.jpg"
|
filename: "an_image.jpg"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user