Use byte array for proxy response
@@ -5,7 +5,6 @@ import com.yahoo.container.jdisc.HttpResponse;
import java.io.IOException;
import java.io.OutputStream;
-import java.nio.charset.StandardCharsets;
import java.util.Optional;
/**
@@ -13,10 +12,10 @@ import java.util.Optional;
*/
public class ProxyResponse extends HttpResponse {
- private final String content;
+ private final byte[] content;
private final String contentType;
- public ProxyResponse(String content, String contentType, int status) {
+ public ProxyResponse(byte[] content, String contentType, int status) {
super(status);
this.content = content;
this.contentType = contentType;
@@ -24,7 +23,7 @@ public class ProxyResponse extends HttpResponse {
@Override
public void render(OutputStream outputStream) throws IOException {
- outputStream.write(content.getBytes(StandardCharsets.UTF_8));
+ outputStream.write(content);
}
@Override
