Switch to filtering out various xml and html types by focusing on the subtype

This commit is contained in:
Mark Felder 2023-05-31 10:24:51 -04:00
parent 70023a1571
commit 33d566f2ac

View file

@ -118,15 +118,10 @@ defmodule Pleroma.Web.Plugs.UploadedMedia do
[_type, subtype] = String.split(mimetype, "/")
cond do
String.contains?(subtype, ["javascript", "ecmascript", "jscript"]) ->
plaintext_header()
String.contains?(mimetype, ["text/html", "text/xml", "application/xml"]) ->
plaintext_header()
true ->
[]
if String.contains?(subtype, ["javascript", "ecmascript", "jscript", "html", "xml"]) do
plaintext_header()
else
[]
end
end