From d7bb750475b6e0764e34f67fd27decb5ee697c8e Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 13 Jun 2016 14:06:31 +0200 Subject: Add dummy EntityResolver to prevent 1 minute freezes --- src/main/java/edu/kit/scc/dei/ecplean/ECPAuthenticatorBase.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/edu/kit/scc/dei/ecplean/ECPAuthenticatorBase.java b/src/main/java/edu/kit/scc/dei/ecplean/ECPAuthenticatorBase.java index ff48afb..0607281 100644 --- a/src/main/java/edu/kit/scc/dei/ecplean/ECPAuthenticatorBase.java +++ b/src/main/java/edu/kit/scc/dei/ecplean/ECPAuthenticatorBase.java @@ -34,6 +34,7 @@ import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.util.EntityUtils; import org.w3c.dom.Document; +import org.xml.sax.EntityResolver; import org.xml.sax.InputSource; import org.xml.sax.SAXException; @@ -124,6 +125,12 @@ public abstract class ECPAuthenticatorBase extends Observable { protected Document buildDocumentFromString(String input) throws IOException, ParserConfigurationException, SAXException { DocumentBuilder builder = documentBuilderFactory.newDocumentBuilder(); + builder.setEntityResolver(new EntityResolver() { + @Override + public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException { + return new InputSource(new StringReader("")); + } + }); return builder.parse(new InputSource(new StringReader(input))); } -- cgit v1.2.3-55-g7522