Skip to content

Commit

Permalink
prepare for 2.7.8
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Sep 27, 2016
1 parent 48759e9 commit eeff2c3
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions release-notes/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ No changes since 2.7.

#210: In `ToXmlGenerator` `WRITE_BIGDECIMAL_AS_PLAIN` is used the wrong way round
(reported by xmluzr@github)
#211: Disable `SUPPORT_DTD` for `XMLInputFactory` unless explicitly overridden

2.7.7 (27-Aug-2016)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ protected XmlFactory(ObjectCodec oc, int xpFeatures, int xgFeatures,
xmlIn = XMLInputFactory.newInstance();
// as per [dataformat-xml#190], disable external entity expansion by default
xmlIn.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, Boolean.FALSE);
// and ditto wrt [dataformat-xml#211], SUPPORT_DTD
xmlIn.setProperty(XMLInputFactory.SUPPORT_DTD, Boolean.FALSE);
}
if (xmlOut == null) {
xmlOut = XMLOutputFactory.newInstance();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.fasterxml.jackson.dataformat.xml.failing;

import java.util.Map;

import com.fasterxml.jackson.dataformat.xml.*;

// for [databind-xml#211]
public class SupportDTDDefaultsTest extends XmlTestBase
{
public void testDTDAttempt() throws Exception
{
XmlMapper mapper = new XmlMapper();
String XML = "<?xml version='1.0' encoding='UTF-8'?><!DOCTYPE foo SYSTEM 'http://127.0.0.1:8001' [ ]>\n"
+"<foo/>";

try {
/*Map<String, String> info =*/ mapper.readValue(XML, Map.class);
//At this point a GET request would have been sent to localhost:8001. You will see a Connection Refused in case you don't have a server listening there.
} catch (Exception e){
fail("Should not try to resolve external DTD subset: "+e);
}
}
}

0 comments on commit eeff2c3

Please sign in to comment.