Digest session credentials in instrumented fragment keys

This commit is contained in:
GPT on behalf of DHH
2026-10-07 21:45:31 +02:00
parent a95361dd15
commit 105f4b8fd1
2 changed files with 7 additions and 1 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ module CachedResponses
def combined_fragment_cache_key(key)
@fragment_cache_namespace ||= [
@response_cache_version, request.base_url, request.script_name, request.format.to_s, I18n.locale,
Current.user&.id, Current.session&.token,
Current.user&.id, (Digest::SHA256.hexdigest(Current.session.token) if Current.session),
(Digest::SHA256.hexdigest(real_csrf_token) if request.format.html? || request.format.turbo_stream?)
].freeze
super([ @fragment_cache_namespace, key ])