Class: Merb::Rack::ConditionalGet

Inherits:
Middleware show all
Defined in:
merb-core/lib/merb-core/rack/middleware/conditional_get.rb

Instance Method Summary (collapse)

Methods inherited from Middleware

#initialize

Methods included from DeferrableMiddleware

#deferred?

Constructor Details

This class inherits a constructor from Merb::Rack::Middleware

Instance Method Details

- (Object) call(env)



7
8
9
10
11
12
13
14
15
16
17
18
# File 'merb-core/lib/merb-core/rack/middleware/conditional_get.rb', line 7

def call(env)
  status, headers, body = @app.call(env)

  if document_not_modified?(env, headers)
    status = 304
    body = Merb::Const::EMPTY_STRING
    # set Date header using RFC1123 date format as specified by HTTP
    # RFC2616 section 3.3.1.
  end
  
  [status, headers, body]
end