-
-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
48759e9
commit eeff2c3
Showing
3 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/test/java/com/fasterxml/jackson/dataformat/xml/failing/SupportDTDDefaultsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} |