BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
1004638c
Commit
1004638c
authored
Mar 17, 2016
by
Kamil Trzciński
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix/reuse-existing-no-cache-method' into 'master'
Reuse `no_cache_headers` method in badges controller Closes #14100 See merge request !3269
parents
4171933c
019fed0f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
13 deletions
+2
-13
badges_controller.rb
app/controllers/projects/badges_controller.rb
+1
-12
build.rb
features/steps/project/badges/build.rb
+1
-1
No files found.
app/controllers/projects/badges_controller.rb
View file @
1004638c
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 @
1004638c
...
...
@@ -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