Commit 33961ee4 authored by Z.J. van de Weg's avatar Z.J. van de Weg

Add Etag caching for Pipeline#Show action

Due to a typo this was not actually the case. Now that is fixed and
performance should improve because of this.
parent 50a00442
......@@ -38,7 +38,7 @@ module Gitlab
'project_pipelines'
),
Gitlab::EtagCaching::Router::Route.new(
%r(^(?!.*(#{RESERVED_WORDS})).*/pipelines/\d+\.json\z),
%r(^(?!.*(#{RESERVED_WORDS_REGEX})).*/pipelines/\d+\.json\z),
'project_pipeline'
)
].freeze
......
......@@ -77,6 +77,17 @@ describe Gitlab::EtagCaching::Router do
expect(result).to be_blank
end
it 'matches pipeline#show endpoint' do
env = build_env(
'/my-group/my-project/pipelines/2.json'
)
result = described_class.match(env)
expect(result).to be_present
expect(result.name).to eq 'project_pipeline'
end
def build_env(path)
{ 'PATH_INFO' => path }
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment