diff options
-rw-r--r-- | CHANGES.txt | 7 | ||||
-rw-r--r-- | src/webob/cachecontrol.py | 1 | ||||
-rw-r--r-- | tests/test_cachecontrol.py | 3 |
3 files changed, 10 insertions, 1 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 8b5a51c..b44298e 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,10 @@ +unreleased +---------- + +- Support setting the ``Cache-Control: immutable`` response header via + ``response.cache_control.immutable = True`` and + ``response.cache_expires(immutable=True)``. + 1.8.0rc1 (2018-01-01) --------------------- diff --git a/src/webob/cachecontrol.py b/src/webob/cachecontrol.py index 9176ec9..45df7ba 100644 --- a/src/webob/cachecontrol.py +++ b/src/webob/cachecontrol.py @@ -205,6 +205,7 @@ class CacheControl(object): stale_while_revalidate = value_property( 'stale-while-revalidate', type='response') stale_if_error = value_property('stale-if-error', type='response') + immutable = exists_property('immutable', type='response') def __str__(self): return serialize_cache_control(self.properties) diff --git a/tests/test_cachecontrol.py b/tests/test_cachecontrol.py index 04ddaa6..ce299d9 100644 --- a/tests/test_cachecontrol.py +++ b/tests/test_cachecontrol.py @@ -227,10 +227,11 @@ class TestCacheControl(object): def test_parse(self): from webob.cachecontrol import CacheControl - cc = CacheControl.parse("public, max-age=315360000") + cc = CacheControl.parse("public, max-age=315360000, immutable") assert type(cc) == CacheControl assert cc.max_age == 315360000 assert cc.public is True + assert cc.immutable is True def test_parse_updates_to(self): from webob.cachecontrol import CacheControl |