mirror of
https://github.com/sinatra/sinatra
synced 2023-03-27 23:18:01 -04:00
cache request object
This commit is contained in:
parent
b81cbe206a
commit
ef69971efa
1 changed files with 4 additions and 0 deletions
|
@ -11,6 +11,10 @@ module Sinatra
|
|||
# The request object. See Rack::Request for more info:
|
||||
# http://rack.rubyforge.org/doc/classes/Rack/Request.html
|
||||
class Request < Rack::Request
|
||||
def self.new(env)
|
||||
env['sinatra.request'] ||= super
|
||||
end
|
||||
|
||||
# Returns an array of acceptable media types for the response
|
||||
def accept
|
||||
@env['sinatra.accept'] ||= begin
|
||||
|
|
Loading…
Add table
Reference in a new issue