Skip to content

Commit

Permalink
Merge pull request #2050 from mapfish/backport/2047-to-master
Browse files Browse the repository at this point in the history
[Backport master] Force data protocol handler
  • Loading branch information
sbrunner authored Sep 9, 2021
2 parents 7c18fca + fe80c2a commit bdb8033
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit bdb8033

Please sign in to comment.