summaryrefslogtreecommitdiff
path: root/app/controllers/uploads_controller.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-14 15:06:07 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-14 15:06:07 +0000
commit429d1abad29d379d8bc8f5219eb72384ad485deb (patch)
tree5c8f9c96c203dbeb3e3e89f3979ce60453340f3f /app/controllers/uploads_controller.rb
parente464f195ff5debc3e9aad0f8c4537404b92019c6 (diff)
downloadgitlab-ce-429d1abad29d379d8bc8f5219eb72384ad485deb.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers/uploads_controller.rb')
-rw-r--r--app/controllers/uploads_controller.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/app/controllers/uploads_controller.rb b/app/controllers/uploads_controller.rb
index 2adfeab182e..635db386792 100644
--- a/app/controllers/uploads_controller.rb
+++ b/app/controllers/uploads_controller.rb
@@ -81,8 +81,13 @@ class UploadsController < ApplicationController
end
end
- def cache_publicly?
- User === model || Appearance === model
+ def cache_settings
+ case model
+ when User, Appearance
+ [5.minutes, { public: true, must_revalidate: false }]
+ when Project, Group
+ [5.minutes, { private: true, must_revalidate: true }]
+ end
end
def secret?