Sha256: 8a0ccd3c3b7966fef128213ff915b791cc5ac73ce45899fff5a6844529c31ac5

Contents?: true

Size: 1.13 KB

Versions: 136

Compression:

Stored size: 1.13 KB

Contents

require 'rack/request'
require 'rack/cache/cachecontrol'

module Rack::Cache

  # Provides access to the HTTP request. The +request+ and +original_request+
  # objects exposed by the Core caching engine are instances of this class.
  #
  # Request objects respond to a variety of convenience methods, including
  # everything defined by Rack::Request as well as the Headers and
  # RequestHeaders modules.
  class Request < Rack::Request
    # The HTTP request method. This is the standard implementation of this
    # method but is respecified here due to libraries that attempt to modify
    # the behavior to respect POST tunnel method specifiers. We always want
    # the real request method.
    def request_method
      @env['REQUEST_METHOD']
    end

    # A CacheControl instance based on the request's Cache-Control header.
    def cache_control
      @cache_control ||= CacheControl.new(env['HTTP_CACHE_CONTROL'])
    end

    # True when the Cache-Control/no-cache directive is present or the
    # Pragma header is set to no-cache.
    def no_cache?
      cache_control['no-cache'] ||
        env['HTTP_PRAGMA'] == 'no-cache'
    end
  end
end

Version data entries

136 entries across 112 versions & 23 rubygems

Version Path
railscast-assets-0.0.2 vendor/bundle/gems/rack-cache-1.2/lib/rack/cache/request.rb
backbone-forms-on-rails-0.10.0 vendor/bundle/gems/backbone-forms-on-rails-0.10.0/vendor/bundle/gems/rack-cache-1.2/lib/rack/cache/request.rb
backbone-forms-on-rails-0.10.0 vendor/bundle/gems/rack-cache-1.2/lib/rack/cache/request.rb
backbone-deep-rails-0.0.1 vendor/bundle/gems/rack-cache-1.2/lib/rack/cache/request.rb
challah-0.9.1.beta vendor/bundle/gems/rack-cache-1.2/lib/rack/cache/request.rb
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/request.rb
challah-0.9.0 vendor/bundle/gems/rack-cache-1.2/lib/rack/cache/request.rb
jquery_regex-0.0.3 vendor/bundle/gems/rack-cache-1.2/lib/rack/cache/request.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.3/vendor/bundle/gems/jquery_regex-0.0.1/vendor/bundle/gems/rack-cache-1.2/lib/rack/cache/request.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.3/vendor/bundle/gems/jquery_regex-0.0.2/vendor/bundle/gems/rack-cache-1.2/lib/rack/cache/request.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.2/vendor/bundle/gems/jquery_regex-0.0.1/vendor/bundle/gems/rack-cache-1.2/lib/rack/cache/request.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.3/vendor/bundle/gems/rack-cache-1.2/lib/rack/cache/request.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.1/vendor/bundle/gems/rack-cache-1.2/lib/rack/cache/request.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.2/vendor/bundle/gems/rack-cache-1.2/lib/rack/cache/request.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.3/vendor/bundle/gems/jquery_regex-0.0.2/vendor/bundle/gems/jquery_regex-0.0.1/vendor/bundle/gems/rack-cache-1.2/lib/rack/cache/request.rb
jquery_regex-0.0.1 vendor/bundle/gems/rack-cache-1.2/lib/rack/cache/request.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/rack-cache-1.2/lib/rack/cache/request.rb
challah-rolls-0.2.0 vendor/bundle/gems/rack-cache-1.2/lib/rack/cache/request.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.0.pre/vendor/bundle/gems/rack-cache-1.2/lib/rack/cache/request.rb
challah-0.8.3 vendor/bundle/gems/rack-cache-1.2/lib/rack/cache/request.rb