Skip to content

Commit

Permalink
override Rack::Request#params method because the original one ignores…
Browse files Browse the repository at this point in the history
… params in bodies of PUT requests (?!)
  • Loading branch information
mislav committed Jan 14, 2009
1 parent f8a37f2 commit 26e7328
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app.rb
@@ -1,9 +1,20 @@
require "integrity"
require "integrity/helpers"
require "sinatra"

require "rack/contrib"
use Rack::NestedParams

Sinatra::Request.class_eval do
# override Rack method because the original one
# ignores params in bodies of PUT requests (?!)
def params
self.GET.update(self.POST)
rescue EOFError => e
self.GET
end
end

set :root, Integrity.root
set :public, Integrity.root / "public"
set :views, Integrity.root / "views"
Expand Down

0 comments on commit 26e7328

Please sign in to comment.