Sha256: 71b9020f390fa767964d898fd60c705241215ba11377e771e91ddc51d25f07e7

Contents?: true

Size: 650 Bytes

Versions: 21

Compression:

Stored size: 650 Bytes

Contents

require 'scrivito/cms_backend'

module Scrivito
  module CmsBackend
    # prevent the use of local URLs (localhost:7104) from cache
    # when running under a server
    def self.find_blob_data_from_cache(id, access, verb, options)
      cache_key = blob_data_cache_key(normalize_blob_id(id), access, verb, options)
      data = CmsDataCache.cache.read(cache_key)

      if !data.nil? && Fiona7::Middleware::ServerDetectionMiddleware.server_detected?
        tainted_data = data['url'] =~ /\Ahttps?:\/\/localhost:7104/

        if tainted_data
          nil
        else
          data
        end
      else
        data
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
infopark_fiona7-1.2.0.0.0 lib/fiona7/scrivito_patches/cms_backend.rb