Commit 63a6453c authored by Adam Niedzielski's avatar Adam Niedzielski

Use NamespaceValidator::WILDCARD_ROUTES in ETag caching middleware

NamespaceValidator::WILDCARD_ROUTES is less restrictive than
ProjectPathValidator::RESERVED and we really have to avoid only
routes that contain wildcard names.
parent d4349ba6
module Gitlab module Gitlab
module EtagCaching module EtagCaching
class Middleware class Middleware
RESERVED_WORDS = ProjectPathValidator::RESERVED.map { |word| "/#{word}/" }.join('|') RESERVED_WORDS = NamespaceValidator::WILDCARD_ROUTES.map { |word| "/#{word}/" }.join('|')
ROUTE_REGEXP = Regexp.union( ROUTE_REGEXP = Regexp.union(
%r(^(?!.*(#{RESERVED_WORDS})).*/noteable/issue/\d+/notes\z) %r(^(?!.*(#{RESERVED_WORDS})).*/noteable/issue/\d+/notes\z)
) )
......
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