Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/mini_profiler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -425,14 +425,14 @@ def inject_profiler(env, status, headers, body)
# Rack::ETag has already inserted some nonesense in the chain
content_type = headers[Rack::CONTENT_TYPE]

headers['x-miniprofiler-original-cache-control'] = headers[Rack::CACHE_CONTROL] unless headers[Rack::CACHE_CONTROL].nil?

if config.disable_caching
headers.delete(Rack::ETAG)
headers.delete('date') || headers.delete('Date')
headers[Rack::CACHE_CONTROL] = "no-store, must-revalidate, private, max-age=0"
end

headers['x-miniprofiler-original-cache-control'] = headers[Rack::CACHE_CONTROL] unless headers[Rack::CACHE_CONTROL].nil?
headers[Rack::CACHE_CONTROL] = "#{"no-store, " if config.disable_caching}must-revalidate, private, max-age=0"

# inject header
if headers.is_a? Hash
headers['x-miniprofiler-ids'] = ids_comma_separated(env)
Expand Down