this basically removes the content-encoding header.
many thanks to @rmohr for reporting this issue in
| it seems that since pip>=1.5, pip checks the response header of archives
| for Content-Encoding.
| This is what pypiserver currently guesses when you try to download a
| tar.gz archive:
| ('Content-Type', 'application/x-tar')
| ('Content-Encoding', 'gzip')
| What pip now does is decompressing the archive because of the
| Content-Encoding, without removing the .gz. Then it tries to untar
| it. Because of the filename it tries to decompress the tar archive
| This is what pypi returns:
| $ wget -S https://pypi.python.org/packages/source/p/pytz/pytz-2013.9.tar.gz
| Content-Type: application/x-gzip
| Accept-Ranges: bytes
| The patch below returns the same types as pypi does.