Skip to content

Commit

Permalink
fix: handle blank content encoding (#412)
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleksii-Klimov authored Jul 26, 2024
1 parent c8ddc32 commit 60e3b25
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.Pair;
import org.jclouds.blobstore.domain.Blob;
import org.jclouds.blobstore.domain.BlobMetadata;
Expand Down Expand Up @@ -604,7 +605,7 @@ private static Result blobToResult(Blob blob, BlobMetadata meta) {
String encoding = meta.getContentMetadata().getContentEncoding();
try (InputStream stream = blob.getPayload().openStream()) {
body = stream.readAllBytes();
if (encoding != null) {
if (!StringUtils.isBlank(encoding)) {
body = Compression.decompress(encoding, body);
}
}
Expand Down

0 comments on commit 60e3b25

Please sign in to comment.