Browse Source

send dataurl when using b64

tags/2.0.1
Jonathan Cobb 4 years ago
parent
commit
7f0abf92c9
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      wizard-server/src/main/java/org/cobbzilla/wizard/stream/UrlStreamingOutput.java

+ 2
- 1
wizard-server/src/main/java/org/cobbzilla/wizard/stream/UrlStreamingOutput.java View File

@@ -15,6 +15,7 @@ import java.io.OutputStream;


import static org.cobbzilla.util.daemon.ZillaRuntime.die; import static org.cobbzilla.util.daemon.ZillaRuntime.die;
import static org.cobbzilla.util.daemon.ZillaRuntime.shortError; import static org.cobbzilla.util.daemon.ZillaRuntime.shortError;
import static org.cobbzilla.wizard.stream.DataUrlStreamingOutput.dataUrlBytes;


public class UrlStreamingOutput implements StreamingOutput { public class UrlStreamingOutput implements StreamingOutput {


@@ -29,7 +30,7 @@ public class UrlStreamingOutput implements StreamingOutput {
response = HttpUtil.getResponse(new HttpRequestBean(url)); response = HttpUtil.getResponse(new HttpRequestBean(url));
if (base64) { if (base64) {
final String b64data = Base64.encodeBytes(response.getEntity()); final String b64data = Base64.encodeBytes(response.getEntity());
final byte[] b64bytes = b64data.getBytes();
final byte[] b64bytes = dataUrlBytes(response.getContentType(), true, b64data);
this.in = new ByteArrayInputStream(b64bytes); this.in = new ByteArrayInputStream(b64bytes);
this.contentLength = b64bytes.length; this.contentLength = b64bytes.length;
} else { } else {


Loading…
Cancel
Save