Browse Source

Bypass URI resolution for "data:" URLs (RFC 2397). If a large data URL is given to Apache XML Commons Resolver, it tries to construct a java.net.URL from it which takes forever and fails in the end when no protocol handler for "data" URLs is installed.

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@396263 13f79535-47bb-0310-9956-ffa450edef68
pull/25/head
Jeremias Maerki 18 years ago
parent
commit
eecf36362b

+ 3
- 1
src/java/org/apache/fop/apps/FOUserAgent.java View File

@@ -410,7 +410,9 @@ public class FOUserAgent {
*/
public Source resolveURI(String uri, String base) {
Source source = null;
if (uriResolver != null) {
//RFC 2397 data URLs don't need to be resolved, just decode them.
boolean bypassURIResolution = uri.startsWith("data:");
if (!bypassURIResolution && uriResolver != null) {
try {
source = uriResolver.resolve(uri, base);
} catch (TransformerException te) {

+ 3
- 1
src/java/org/apache/fop/apps/FopFactory.java View File

@@ -571,7 +571,9 @@ public class FopFactory {
*/
public Source resolveURI(String uri, String base) {
Source source = null;
if (uriResolver != null) {
//RFC 2397 data URLs don't need to be resolved, just decode them.
boolean bypassURIResolution = uri.startsWith("data:");
if (!bypassURIResolution && uriResolver != null) {
try {
source = uriResolver.resolve(uri, base);
} catch (TransformerException te) {

Loading…
Cancel
Save