Permalink
Browse files

Merge pull request #46 from cfis/fix_post_302

Don't respond with 302 for post/put/head.
  • Loading branch information...
2 parents 2e3a64d + 62970fe commit 5104c34f9d7ff78c4c2de3f8c1f805df2c902985 @rtomayko committed Feb 15, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/rack/cache/context.rb
@@ -83,7 +83,10 @@ def call!(env)
end
# tidy up response a bit
- response.not_modified! if not_modified?(response)
+ if (@request.get? || @request.head?) && not_modified?(response)
+ response.not_modified!
+ end
+
if @request.head?
response.body.close if response.body.respond_to?(:close)
response.body = []

0 comments on commit 5104c34

Please sign in to comment.