Class: Rage::Request
- Inherits:
-
Object
- Object
- Rage::Request
- Defined in:
- lib/rage/request.rb
Instance Method Summary collapse
-
#fresh?(etag:, last_modified:) ⇒ Boolean
Check if the request is fresh.
-
#headers ⇒ Object
Get the request headers.
Instance Method Details
#fresh?(etag:, last_modified:) ⇒ Boolean
Check if the request is fresh.
27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/rage/request.rb', line 27 def fresh?(etag:, last_modified:) # Always render response when no freshness information # is provided in the request. return false unless if_none_match || if_not_modified_since etag_matches?( requested_etags: if_none_match, response_etag: etag ) && not_modified?( request_not_modified_since: if_not_modified_since, response_last_modified: last_modified ) end |
#headers ⇒ Object
Get the request headers.
15 16 17 |
# File 'lib/rage/request.rb', line 15 def headers @headers ||= Headers.new(@env) end |