diff options
author | Yuji Yaginuma <yuuji.yaginuma@gmail.com> | 2019-01-09 07:59:16 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-09 07:59:16 +0900 |
commit | b03d493cf61f37abe7dc0539aee1985b6a9eea63 (patch) | |
tree | 8931b7a68ab5b788c55feaaf51d019c879b63e38 /actionpack/lib | |
parent | d79366b4c9619e70a2c292b3a7c0311618eba9be (diff) | |
parent | c1dd2285799b19b7067119b2aa121ca922b75bc3 (diff) | |
download | rails-b03d493cf61f37abe7dc0539aee1985b6a9eea63.tar.gz rails-b03d493cf61f37abe7dc0539aee1985b6a9eea63.tar.bz2 rails-b03d493cf61f37abe7dc0539aee1985b6a9eea63.zip |
Merge pull request #34885 from y-yagi/fixes_34780
Allow using combine the Cache-Control `public` and `no-cache` headers
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/http/cache.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/actionpack/lib/action_dispatch/http/cache.rb b/actionpack/lib/action_dispatch/http/cache.rb index f67b13f657..8cc84ff36c 100644 --- a/actionpack/lib/action_dispatch/http/cache.rb +++ b/actionpack/lib/action_dispatch/http/cache.rb @@ -197,10 +197,12 @@ module ActionDispatch if control.empty? # Let middleware handle default behavior elsif control[:no_cache] - self._cache_control = NO_CACHE - if control[:extras] - self._cache_control = _cache_control + ", #{control[:extras].join(', ')}" - end + options = [] + options << PUBLIC if control[:public] + options << NO_CACHE + options.concat(control[:extras]) if control[:extras] + + self._cache_control = options.join(", ") else extras = control[:extras] max_age = control[:max_age] |