Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #46 from cfis/fix_post_302

Don't respond with 302 for post/put/head.
  • Loading branch information...
commit 5104c34f9d7ff78c4c2de3f8c1f805df2c902985 2 parents 2e3a64d + 62970fe
@rtomayko authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/rack/cache/context.rb
View
5 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 = []
Please sign in to comment.
Something went wrong with that request. Please try again.