summaryrefslogtreecommitdiff
path: root/lib/gitlab/etag_caching
diff options
context:
space:
mode:
authorZ.J. van de Weg <git@zjvandeweg.nl>2017-06-12 14:29:54 +0200
committerZ.J. van de Weg <git@zjvandeweg.nl>2017-06-12 21:50:35 +0200
commitcd1a85427ab828e7224f95ee931a8ed3f3886962 (patch)
treec9bb416601091831a56fe2700c6660f05abcf349 /lib/gitlab/etag_caching
parentf20949a332cf13bb0a75d6a4290aec525db35885 (diff)
downloadgitlab-ce-cd1a85427ab828e7224f95ee931a8ed3f3886962.tar.gz
Revert to passing the path when matching key to the routerzj-raise-etag-route-regex-miss
This was edited to the request, but this won't work if the data is not available at the time of setting the key for the first time.
Diffstat (limited to 'lib/gitlab/etag_caching')
-rw-r--r--lib/gitlab/etag_caching/middleware.rb2
-rw-r--r--lib/gitlab/etag_caching/router.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/gitlab/etag_caching/middleware.rb b/lib/gitlab/etag_caching/middleware.rb
index 7f884183bb1..1d6f5bb5e1c 100644
--- a/lib/gitlab/etag_caching/middleware.rb
+++ b/lib/gitlab/etag_caching/middleware.rb
@@ -7,7 +7,7 @@ module Gitlab
def call(env)
request = Rack::Request.new(env)
- route = Gitlab::EtagCaching::Router.match(request)
+ route = Gitlab::EtagCaching::Router.match(request.path_info)
return @app.call(env) unless route
track_event(:etag_caching_middleware_used, route)
diff --git a/lib/gitlab/etag_caching/router.rb b/lib/gitlab/etag_caching/router.rb
index dccc66b3918..75167a6b088 100644
--- a/lib/gitlab/etag_caching/router.rb
+++ b/lib/gitlab/etag_caching/router.rb
@@ -53,8 +53,8 @@ module Gitlab
)
].freeze
- def self.match(request)
- ROUTES.find { |route| route.regexp.match(request.path_info) }
+ def self.match(path)
+ ROUTES.find { |route| route.regexp.match(path) }
end
end
end