Module: Rack::Cache::RequestHeaders

Includes:
Headers
Included in:
Request
Defined in:
lib/rack/cache/headers.rb

Overview

HTTP request header helpers. When included in Rack::Cache::Request, headers may be accessed by their standard RFC 2616 names using the #headers Hash.

Instance Method Summary collapse

Methods included from Headers

#cache_control, #cache_control=, #etag, #header?

Instance Method Details

#headersObject

A Hash-like object providing access to HTTP request headers.



61
62
63
# File 'lib/rack/cache/headers.rb', line 61

def headers
  @headers ||= Rack::Utils::EnvironmentHeaders.new(env)
end

#if_modified_sinceObject

The literal value of the If-Modified-Since request header or nil when no If-Modified-Since header is present.



67
68
69
# File 'lib/rack/cache/headers.rb', line 67

def if_modified_since
  headers['If-Modified-Since']
end

#if_none_matchObject

The literal value of the If-None-Match request header or nil when no If-None-Match header is present.



73
74
75
# File 'lib/rack/cache/headers.rb', line 73

def if_none_match
  headers['If-None-Match']
end