Skip to content

Instantly share code, notes, and snippets.

@mss
Created October 3, 2013 21:19
Show Gist options
  • Save mss/6817300 to your computer and use it in GitHub Desktop.
Save mss/6817300 to your computer and use it in GitHub Desktop.
Fix for JERSEY-2126 aka dropwizard issue 403
Index: src/main/java/com/sun/jersey/client/apache4/ApacheHttpClient4Handler.java
===================================================================
--- src/main/java/com/sun/jersey/client/apache4/ApacheHttpClient4Handler.java (revision 5854)
+++ src/main/java/com/sun/jersey/client/apache4/ApacheHttpClient4Handler.java (working copy)
@@ -71,6 +71,7 @@
import javax.ws.rs.core.MultivaluedMap;
import java.io.BufferedInputStream;
import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
import java.io.Closeable;
import java.io.FilterInputStream;
import java.io.IOException;
@@ -254,7 +255,9 @@
@Override
public InputStream getContent() throws IOException, IllegalStateException {
- return null;
+ ByteArrayOutputStream buffer = new ByteArrayOutputStream(512);
+ writeTo(buffer);
+ return new ByteArrayInputStream(buffer.toByteArray());
}
@Override
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment