fix sonarqube warning about xxe processing

This commit is contained in:
Sebastian Sdorra
2019-11-28 10:45:57 +01:00
parent bfcc9bf4a6
commit 312fb9bb05

View File

@@ -52,7 +52,9 @@ public final class XmlStreams {
}
private static XMLStreamReader createReader(Reader reader) throws XMLStreamException {
return XMLInputFactory.newInstance().createXMLStreamReader(reader);
XMLInputFactory factory = XMLInputFactory.newInstance();
factory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, Boolean.FALSE);
return factory.createXMLStreamReader(reader);
}