diff options
author | Simon Rettberg | 2016-06-13 14:06:31 +0200 |
---|---|---|
committer | Simon Rettberg | 2016-06-13 14:06:31 +0200 |
commit | d7bb750475b6e0764e34f67fd27decb5ee697c8e (patch) | |
tree | fa5455b5b4942bba6c221d3750183c322eff91ff /src | |
parent | Apply short timeouts to http requests (diff) | |
download | ecp-client-lean-d7bb750475b6e0764e34f67fd27decb5ee697c8e.tar.gz ecp-client-lean-d7bb750475b6e0764e34f67fd27decb5ee697c8e.tar.xz ecp-client-lean-d7bb750475b6e0764e34f67fd27decb5ee697c8e.zip |
Add dummy EntityResolver to prevent 1 minute freezes
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/edu/kit/scc/dei/ecplean/ECPAuthenticatorBase.java | 7 |
1 files changed, 7 insertions, 0 deletions
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)));
}
|