mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FIX: Use a cookie to bypass the anon cache
This commit is contained in:
@ -64,8 +64,13 @@ module Middleware
|
||||
CurrentUser.has_auth_cookie?(@env)
|
||||
end
|
||||
|
||||
def no_cache_bypass
|
||||
request = Rack::Request.new(@env)
|
||||
request.cookies['_bypass_cache'].nil?
|
||||
end
|
||||
|
||||
def cacheable?
|
||||
!!(!has_auth_cookie? && get?)
|
||||
!!(!has_auth_cookie? && get? && no_cache_bypass)
|
||||
end
|
||||
|
||||
def cached
|
||||
|
Reference in New Issue
Block a user