]> khamidou — GitHub mirrors - vcrpy.git/commit
Add HeadersDict, and mark add_header deprecated.
authorAron Griffis <aron@arongriffis.com>
Tue, 25 Aug 2015 02:14:38 +0000 (22:14 -0400)
committerAron Griffis <aron@arongriffis.com>
Tue, 25 Aug 2015 10:30:50 +0000 (06:30 -0400)
commit7312229aefe187f21fc0a28b72d6717db09bc584
tree6c5a988e55a957b7e0d41626874c16bfaaf6f601
parent646d12df943d54f8808160c745f1cf297eecb3db
Add HeadersDict, and mark add_header deprecated.

HeadersDict is a subclass of CaseInsensitiveDict with two new features:

  1. Preserve the case of the header key from the first time it was set.
     This means that later munging won't modify the key case. (You can
     force picking up the new case with `del` followed by setting.)

  2. If the value is a list or tuple, unpack it and store the first
     element. This is the same as how `Request.add_header()` used to work.

For backward compatibility this commit preserves `Request.add_header()` but
marks it deprecated.
tests/unit/test_filters.py
tests/unit/test_request.py
vcr/request.py
vcr/stubs/__init__.py