We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent da05473 commit dab685dCopy full SHA for dab685d
src/clj_http/util.clj
@@ -59,7 +59,11 @@
59
"Returns a zlib inflate'd version of the given byte array."
60
[b]
61
(when b
62
- (IOUtils/toByteArray (InflaterInputStream. (ByteArrayInputStream. b)))))
+ (try
63
+ (IOUtils/toByteArray (InflaterInputStream. (ByteArrayInputStream. b)))
64
+ (catch java.util.zip.ZipException e ;broken inflate implementation server-side,
65
+ ; see http://stackoverflow.com/questions/3932117/handling-http-contentencoding-deflate
66
+ (IOUtils/toByteArray (InflaterInputStream. (ByteArrayInputStream. b) (java.util.zip.Inflater. true)))))))
67
68
(defn deflate
69
"Returns a deflate'd version of the given byte array."
0 commit comments