mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 01:57:15 +08:00
FIX: Bypass AnonymousCache
for /srv/status
route. (#11491)
`/srv/status` routes should not be cached at all. Also, we want to decouple the route from Redis which `AnonymouseCache` relies on. The `/srv/status` should continue to return a success response even if Redis is down.
This commit is contained in:

committed by
GitHub

parent
89bf64c0bf
commit
38b6b098bc
@ -163,6 +163,7 @@ module Middleware
|
||||
def no_cache_bypass
|
||||
request = Rack::Request.new(@env)
|
||||
request.cookies['_bypass_cache'].nil? &&
|
||||
(request.path != '/srv/status') &&
|
||||
request[Auth::DefaultCurrentUserProvider::API_KEY].nil? &&
|
||||
@env[Auth::DefaultCurrentUserProvider::USER_API_KEY].nil?
|
||||
end
|
||||
|
Reference in New Issue
Block a user