Commit 0ef98c4a authored by James Fargher's avatar James Fargher

Merge branch '337894-fix-etag-caching-regex-for-environments' into 'master'

Resolve "Fix ETag caching regex for environments"

See merge request gitlab-org/gitlab!67708
parents 03903b0a b045ab5d
......@@ -71,7 +71,7 @@ module Gitlab
'continuous_delivery'
],
[
%r(#{RESERVED_WORDS_PREFIX}/environments\.json\z),
%r(#{RESERVED_WORDS_PREFIX}/-/environments\.json\z),
'environments',
'continuous_delivery'
],
......
......@@ -87,12 +87,18 @@ RSpec.describe Gitlab::EtagCaching::Router::Restful do
end
it 'matches the environments path' do
result = match_route('/my-group/my-project/environments.json')
result = match_route('/my-group/my-project/-/environments.json')
expect(result).to be_present
expect(result.name).to eq 'environments'
end
it 'does not match the operations environments list path' do
result = match_route('/-/operations/environments.json')
expect(result).not_to be_present
end
it 'matches pipeline#show endpoint' do
result = match_route('/my-group/my-project/-/pipelines/2.json')
......
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