Skip to content

Commit 53a119c

Browse files
committed
set setExpandEntities to false on SAXBuilder.
1 parent c0f325f commit 53a119c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/com/aliyun/oss/internal/ResponseParsers.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,10 +1247,10 @@ public static <ResultType extends GenericResult> void setServerCRC(ResultType re
12471247

12481248
private static Element getXmlRootElement(InputStream responseBody) throws Exception {
12491249
SAXBuilder builder = new SAXBuilder();
1250-
builder.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
1251-
builder.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
1250+
builder.setFeature("http://apache.org/xml/features/disallow-doctype-decl",true);
12521251
builder.setFeature("http://xml.org/sax/features/external-general-entities", false);
12531252
builder.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
1253+
builder.setExpandEntities(false);
12541254
Document doc = builder.build(responseBody);
12551255
return doc.getRootElement();
12561256
}

0 commit comments

Comments
 (0)