Distribution.Client.GZipUtils

cabal-install-3.12.1.0: The command-line interface for Cabal and Hackage.

Copyright | (c) Dmitry Astapov 2010
License | BSD-like
Maintainer | cabal-devel@gmail.com
Stability | provisional
Portability | portable
Safe Haskell | None
Language | Haskell2010

Distribution.Client.GZipUtils

Description

Provides a convenience functions for working with files that may or may not be zipped.

Synopsis

- maybeDecompress :: ByteString -> ByteString

# Documentation

maybeDecompress :: ByteString -> ByteString #

Attempts to decompress the `bytes` under the assumption that "data format" error at the very beginning of the stream means that it is already decompressed. Caller should make sanity checks to verify that it is not, in fact, garbage.

This is to deal with http proxies that lie to us and transparently decompress without removing the content-encoding header. See: https://github.com/haskell/cabal/issues/678