Permalink
Browse files

Don't respond with 302 for post/put/head. Fixes #44.

  • Loading branch information...
1 parent 7e529ac commit 62970fe07bff855816ff86f755f8422419025f83 @cfis cfis committed Jan 10, 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 62970fe

Please sign in to comment.