diff --git a/src/Geta.NotFoundHandler/Core/Redirects/RedirectsXmlParser.cs b/src/Geta.NotFoundHandler/Core/Redirects/RedirectsXmlParser.cs index cc6152f..9b1a1ff 100644 --- a/src/Geta.NotFoundHandler/Core/Redirects/RedirectsXmlParser.cs +++ b/src/Geta.NotFoundHandler/Core/Redirects/RedirectsXmlParser.cs @@ -33,9 +33,17 @@ public RedirectsXmlParser(ILogger logger) public CustomRedirectCollection LoadFromStream(Stream xmlContent) { _customRedirectsXmlFile = new XmlDocument(); + if (xmlContent != null) { - _customRedirectsXmlFile.Load(xmlContent); + var settings = new XmlReaderSettings + { + DtdProcessing = DtdProcessing.Prohibit, + XmlResolver = null + }; + + using var reader = XmlReader.Create(xmlContent, settings); + _customRedirectsXmlFile.Load(reader); } else {