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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
019fed0f
Commit
019fed0f
authored
Mar 17, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reuse `no_cache_headers` method in badges controller
parent
4171933c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
13 deletions
+2
-13
app/controllers/projects/badges_controller.rb
app/controllers/projects/badges_controller.rb
+1
-12
features/steps/project/badges/build.rb
features/steps/project/badges/build.rb
+1
-1
No files found.
app/controllers/projects/badges_controller.rb
View file @
019fed0f
class
Projects::BadgesController
<
Projects
::
ApplicationController
before_action
:
set_no_cache
before_action
:
no_cache_headers
def
build
respond_to
do
|
format
|
...
...
@@ -10,15 +10,4 @@ class Projects::BadgesController < Projects::ApplicationController
end
end
end
private
def
set_no_cache
expires_now
# Add some deprecated headers for older agents
#
response
.
headers
[
'Pragma'
]
=
'no-cache'
response
.
headers
[
'Expires'
]
=
'Fri, 01 Jan 1990 00:00:00 GMT'
end
end
features/steps/project/badges/build.rb
View file @
019fed0f
...
...
@@ -21,7 +21,7 @@ class Spinach::Features::ProjectBadgesBuild < Spinach::FeatureSteps
end
step
'I should see a badge that has not been cached'
do
expect
(
page
.
response_headers
).
to
include
(
'Cache-Control'
=>
'no-cache'
)
expect
(
page
.
response_headers
[
'Cache-Control'
]).
to
include
'no-cache'
end
def
expect_badge
(
status
)
...
...
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