diff --git a/http2.d b/http2.d index d23c762..d751fd0 100644 --- a/http2.d +++ b/http2.d @@ -686,11 +686,12 @@ class HttpRequest { //goto done; // FIXME state = State.complete; - auto n = uncompress.uncompress(responseData.content); - n ~= uncompress.flush(); - responseData.content = cast(ubyte[]) n; + if(bodyReadingState.isGzipped || bodyReadingState.isDeflated) { + auto n = uncompress.uncompress(responseData.content); + n ~= uncompress.flush(); + responseData.content = cast(ubyte[]) n; + } - //if(bodyReadingState.isGzipped || bodyReadingState.isDeflated) // responseData.content ~= cast(ubyte[]) uncompress.flush(); responseData.contentText = cast(string) responseData.content;