diff options
author | Z.J. van de Weg <git@zjvandeweg.nl> | 2017-06-12 14:29:54 +0200 |
---|---|---|
committer | Z.J. van de Weg <git@zjvandeweg.nl> | 2017-06-12 21:50:35 +0200 |
commit | cd1a85427ab828e7224f95ee931a8ed3f3886962 (patch) | |
tree | c9bb416601091831a56fe2700c6660f05abcf349 /lib | |
parent | f20949a332cf13bb0a75d6a4290aec525db35885 (diff) | |
download | gitlab-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')
-rw-r--r-- | lib/gitlab/etag_caching/middleware.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/etag_caching/router.rb | 4 |
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 |