Skip to content

Commit

Permalink
Fixed GZIP decoding for streams that are not yet read up to 2 bytes, a…
Browse files Browse the repository at this point in the history
  • Loading branch information
smarek committed Aug 24, 2015
1 parent 2f4d1d8 commit dc18480
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1608,7 +1608,8 @@ public InflatingEntity(HttpEntity wrapped) {
public InputStream getContent() throws IOException {
wrappedStream = wrappedEntity.getContent();
pushbackStream = new PushbackInputStream(wrappedStream, 2);
if (isInputStreamGZIPCompressed(pushbackStream)) {
Header enc = wrappedEntity.getContentEncoding();
if ((enc != null && "gzip".equalsIgnoreCase(enc.getValue())) || isInputStreamGZIPCompressed(pushbackStream)) {
gzippedStream = new GZIPInputStream(pushbackStream);
return gzippedStream;
} else {
Expand Down

0 comments on commit dc18480

Please sign in to comment.