Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

cache request object

  • Loading branch information...
commit 82a7b8e2e4a525bc68a057178ae9bfbae0e8f1e0 1 parent b6b0414
@rkh rkh authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/sinatra/base.rb
View
4 lib/sinatra/base.rb
@@ -12,6 +12,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
Please sign in to comment.
Something went wrong with that request. Please try again.