Skip to content
Snippets Groups Projects
Commit ce5bb26e authored by Oleg Grenrus's avatar Oleg Grenrus
Browse files

maybeDecompress: bail on all errors at the beginning of the stream with zlib < 0.6

parent 8da8e665
No related merge requests found
......@@ -77,7 +77,7 @@ maybeDecompress bytes = foldStream $ decompressWithErrors gzipOrZlibFormat defau
-- Returning it as-is.
-- TODO: alternatively, we might consider looking for the two magic bytes
-- at the beginning of the gzip header.
foldStream (StreamError DataError _) = bytes
foldStream (StreamError _ _) = bytes
foldStream somethingElse = doFold somethingElse
doFold StreamEnd = BS.Empty
......
{-# LANGUAGE CPP #-}
module UnitTests.Distribution.Client.GZipUtils (
tests
) where
......@@ -21,9 +20,7 @@ import Test.Tasty.QuickCheck
tests :: [TestTree]
tests = [ testCase "maybeDecompress" maybeDecompressUnitTest
#if MIN_VERSION_zlib(0,6,0)
, testProperty "decompress plain" prop_maybeDecompress_plain
#endif
, testProperty "decompress zlib" prop_maybeDecompress_zlib
, testProperty "decompress gzip" prop_maybeDecompress_gzip
]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment