Sha256: 3bde2cbfe1db4e0118b723569680dd8f3971999b3c1e20406784178988fc3df5

Contents?: true

Size: 564 Bytes

Versions: 60

Compression:

Stored size: 564 Bytes

Contents

# frozen_string_literal: true

require "active_support/concern"

module Decidim
  # This module will disable http caching from the controller in
  # order to prevent proxies from storing sensible information.
  module HttpCachingDisabler
    extend ActiveSupport::Concern

    included do
      before_action :disable_http_caching
    end

    def disable_http_caching
      response.headers["Cache-Control"] = "no-cache, no-store"
      response.headers["Pragma"] = "no-cache"
      response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT"
    end
  end
end

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
decidim-core-0.26.10 app/controllers/concerns/decidim/http_caching_disabler.rb
decidim-core-0.26.9 app/controllers/concerns/decidim/http_caching_disabler.rb
decidim-core-0.26.8 app/controllers/concerns/decidim/http_caching_disabler.rb
decidim-core-0.26.7 app/controllers/concerns/decidim/http_caching_disabler.rb
decidim-core-0.26.5 app/controllers/concerns/decidim/http_caching_disabler.rb
decidim-core-0.26.4 app/controllers/concerns/decidim/http_caching_disabler.rb
decidim-core-0.26.3 app/controllers/concerns/decidim/http_caching_disabler.rb
decidim-core-0.26.2 app/controllers/concerns/decidim/http_caching_disabler.rb
decidim-core-0.26.1 app/controllers/concerns/decidim/http_caching_disabler.rb
decidim-core-0.26.0 app/controllers/concerns/decidim/http_caching_disabler.rb
decidim-core-0.26.0.rc2 app/controllers/concerns/decidim/http_caching_disabler.rb
decidim-core-0.26.0.rc1 app/controllers/concerns/decidim/http_caching_disabler.rb
decidim-core-0.25.2 app/controllers/concerns/decidim/http_caching_disabler.rb
decidim-core-0.25.1 app/controllers/concerns/decidim/http_caching_disabler.rb
decidim-core-0.25.0 app/controllers/concerns/decidim/http_caching_disabler.rb
decidim-core-0.25.0.rc4 app/controllers/concerns/decidim/http_caching_disabler.rb
decidim-core-0.25.0.rc3 app/controllers/concerns/decidim/http_caching_disabler.rb
decidim-core-0.25.0.rc2 app/controllers/concerns/decidim/http_caching_disabler.rb
decidim-core-0.25.0.rc1 app/controllers/concerns/decidim/http_caching_disabler.rb
decidim-core-0.24.3 app/controllers/concerns/decidim/http_caching_disabler.rb