summaryrefslogtreecommitdiff
path: root/lib/gitlab/etag_caching/router.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/etag_caching/router.rb')
-rw-r--r--lib/gitlab/etag_caching/router.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/gitlab/etag_caching/router.rb b/lib/gitlab/etag_caching/router.rb
index 31a5b9d108b..174fee5ee24 100644
--- a/lib/gitlab/etag_caching/router.rb
+++ b/lib/gitlab/etag_caching/router.rb
@@ -9,7 +9,8 @@ module Gitlab
# - Ending in `noteable/issue/<id>/notes` for the `issue_notes` route
# - Ending in `issues/id`/rendered_title` for the `issue_title` route
USED_IN_ROUTES = %w[noteable issue notes issues rendered_title
- commit pipelines merge_requests new].freeze
+ commit pipelines merge_requests new
+ environments].freeze
RESERVED_WORDS = DynamicPathValidator::WILDCARD_ROUTES - USED_IN_ROUTES
RESERVED_WORDS_REGEX = Regexp.union(*RESERVED_WORDS)
ROUTES = [
@@ -40,6 +41,10 @@ module Gitlab
Gitlab::EtagCaching::Router::Route.new(
%r(^(?!.*(#{RESERVED_WORDS})).*/pipelines/\d+\.json\z),
'project_pipeline'
+ ),
+ Gitlab::EtagCaching::Router::Route.new(
+ %r(^(?!.*(#{RESERVED_WORDS})).*/environments\.json\z),
+ 'environments'
)
].freeze