Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
2d057da1
Commit
2d057da1
authored
Jan 22, 2019
by
Tim Zallmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Turned cache_privately? into cache_publicly?
Also removed unnecessary comment
parent
86cda964
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
8 deletions
+7
-8
app/controllers/concerns/uploads_actions.rb
app/controllers/concerns/uploads_actions.rb
+5
-5
app/controllers/uploads_controller.rb
app/controllers/uploads_controller.rb
+2
-2
spec/controllers/uploads_controller_spec.rb
spec/controllers/uploads_controller_spec.rb
+0
-1
No files found.
app/controllers/concerns/uploads_actions.rb
View file @
2d057da1
...
...
@@ -29,12 +29,12 @@ module UploadsActions
def
show
return
render_404
unless
uploader
&
.
exists?
if
cache_privately?
expires_in
0
.
seconds
,
must_revalidate:
true
,
private:
true
else
if
cache_publicly?
# We need to reset caching from the applications controller to get rid of the no-store value
headers
[
'Cache-Control'
]
=
''
expires_in
5
.
minutes
,
public:
true
,
must_revalidate:
false
else
expires_in
0
.
seconds
,
must_revalidate:
true
,
private:
true
end
disposition
=
uploader
.
image_or_video?
?
'inline'
:
'attachment'
...
...
@@ -120,8 +120,8 @@ module UploadsActions
nil
end
def
cache_p
rivate
ly?
tru
e
def
cache_p
ublic
ly?
fals
e
end
def
model
...
...
app/controllers/uploads_controller.rb
View file @
2d057da1
...
...
@@ -70,8 +70,8 @@ class UploadsController < ApplicationController
end
end
def
cache_p
rivate
ly?
true
unless
User
===
model
||
Appearance
===
model
def
cache_p
ublic
ly?
User
===
model
||
Appearance
===
model
end
def
upload_model_class
...
...
spec/controllers/uploads_controller_spec.rb
View file @
2d057da1
...
...
@@ -14,7 +14,6 @@ end
shared_examples
'content publicly cached'
do
it
'ensures content is publicly cached'
do
# Fixed in newer versions of ActivePack, it will only output a single `private`.
expect
(
subject
[
'Cache-Control'
]).
to
eq
(
'max-age=300, public'
)
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment