Skip to content

Commit fbc288d

Browse files
committed
Make wrapper.CacheControl configurable regarding both controller and adapter.
1 parent f66639f commit fbc288d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cachecontrol/wrapper.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,18 @@ def CacheControl(sess,
66
cache=None,
77
cache_etags=True,
88
serializer=None,
9-
heuristic=None):
9+
heuristic=None,
10+
controller_class=None,
11+
adapter_class=None):
1012

1113
cache = cache or DictCache()
12-
adapter = CacheControlAdapter(
14+
adapter_class = adapter_class or CacheControlAdapter
15+
adapter = adapter_class(
1316
cache,
1417
cache_etags=cache_etags,
1518
serializer=serializer,
1619
heuristic=heuristic,
20+
controller_class=controller_class
1721
)
1822
sess.mount('http://', adapter)
1923
sess.mount('https://', adapter)

0 commit comments

Comments
 (0)