提交 9cc86224 编写于 作者: J Juergen Hoeller

Local https URL resolution attempt with fallback to parser's default

See gh-22504
上级 7cbb3b06
......@@ -114,9 +114,18 @@ public class ResourceEntityResolver extends DelegatingEntityResolver {
if (url.startsWith("http:")) {
url = "https:" + url.substring(5);
}
source = new InputSource(url);
source.setPublicId(publicId);
return source;
try {
source = new InputSource(new URL(url).openStream());
source.setPublicId(publicId);
source.setSystemId(systemId);
}
catch (IOException ex) {
if (logger.isDebugEnabled()) {
logger.debug("Could not resolve XML entity [" + systemId + "] through URL [" + url + "]", ex);
}
// Fall back to the parser's default behavior.
source = null;
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册