mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 17:02:45 +08:00
fix mp in prd
This commit is contained in:
parent
f921d1c547
commit
622568fd57
|
@ -19,8 +19,11 @@ if defined?(Rack::MiniProfiler)
|
|||
# with a load balancer in front this becomes really bad as some results can
|
||||
# be stored associated with ip1 as the user and retrieved using ip2 causing 404s
|
||||
Rack::MiniProfiler.config.user_provider = lambda do |env|
|
||||
user = CurrentUser.lookup_from_env(env)
|
||||
user ? user.id.to_s : Rack::Request.new(env).ip
|
||||
request = Rack::Request.new(env)
|
||||
id = request.cookies["_t"] || request.ip || "unknown"
|
||||
id = id.to_s
|
||||
# some security, lets not have these tokens floating about
|
||||
Digest::MD5.hexdigest(id)
|
||||
end
|
||||
|
||||
Rack::MiniProfiler.config.position = 'left'
|
||||
|
|
Loading…
Reference in New Issue
Block a user