2023-08-04 15:24:32 -06:00
|
|
|
defmodule Pleroma.Web.XMLTest do
|
|
|
|
use Pleroma.DataCase, async: true
|
|
|
|
|
|
|
|
alias Pleroma.Web.XML
|
|
|
|
|
2023-08-05 06:13:49 -06:00
|
|
|
test "refuses to parse any entities from XML" do
|
|
|
|
data = File.read!("test/fixtures/xml_billion_laughs.xml")
|
|
|
|
assert(:error == XML.parse_document(data))
|
|
|
|
end
|
|
|
|
|
2023-08-04 15:24:32 -06:00
|
|
|
test "refuses to load external entities from XML" do
|
|
|
|
data = File.read!("test/fixtures/xml_external_entities.xml")
|
|
|
|
assert(:error == XML.parse_document(data))
|
|
|
|
end
|
|
|
|
end
|