diff --git a/core/src/main/java/org/mapfish/print/http/ConfigFileResolvingHttpRequestFactory.java b/core/src/main/java/org/mapfish/print/http/ConfigFileResolvingHttpRequestFactory.java index a9573a10db..bcf305a575 100644 --- a/core/src/main/java/org/mapfish/print/http/ConfigFileResolvingHttpRequestFactory.java +++ b/core/src/main/java/org/mapfish/print/http/ConfigFileResolvingHttpRequestFactory.java @@ -5,6 +5,7 @@ import org.mapfish.print.processor.Processor; import org.mapfish.print.url.data.DataUrlConnection; +import org.mapfish.print.url.data.Handler; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.slf4j.MDC; @@ -20,6 +21,7 @@ import java.io.InputStream; import java.io.OutputStream; import java.net.URI; +import java.net.URL; import java.util.List; import java.util.NoSuchElementException; import java.util.concurrent.CopyOnWriteArrayList; @@ -113,7 +115,10 @@ protected synchronized ClientHttpResponse executeInternal(final HttpHeaders head return executeCallbacksAndRequest(this.request); } if ("data".equals(this.uri.getScheme())) { - final DataUrlConnection duc = new DataUrlConnection(this.uri.toURL()); + final String urlStr = this.uri.toString(); + final URL url = new URL("data", null, 0, + urlStr.substring("data:".length()), new Handler()); + final DataUrlConnection duc = new DataUrlConnection(url); final InputStream is = duc.getInputStream(); final String contentType = duc.getContentType(); final HttpHeaders responseHeaders = new HttpHeaders();