httppeer: extract common response handling into own function
This allows the common redirect detection, content type
validation, and decompression wrapping to be usable outside of
httppeer instances.
Differential Revision: https://phab.mercurial-scm.org/D3236
To run the tests, do:
cd tests/
python run-tests.py
See https://mercurial-scm.org/wiki/WritingTests for
more information on writing tests.