Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cachecontrol/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@


class CacheControlAdapter(HTTPAdapter):
invalidating_methods = {"PUT", "PATCH", "DELETE"}
invalidating_methods = {"POST", "PUT", "PATCH", "DELETE"}

def __init__(
self,
Expand Down
5 changes: 5 additions & 0 deletions tests/test_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ def test_delete_invalidates_cache(self, url, sess):
sess.get(url)
assert not r2.from_cache

def test_post_invalidates_cache(self, url, sess):
sess.get(url)
sess.post(url, data={"foo": "bar"})
assert not sess.get(url).from_cache

def test_close(self):
cache = mock.Mock(spec=DictCache)
sess = Session()
Expand Down