diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-09-15 11:37:50 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-09-15 11:37:50 -0300 |
commit | b96464e7eeb90983227ae63accd627878f2919b1 (patch) | |
tree | cb4b2c042ea8fef2d6753dfcf921e815a025c64d /actionpack/lib/action_dispatch | |
parent | 3fb492ff8744a7745c89d70cddaa6ebbd268a13f (diff) | |
download | rails-b96464e7eeb90983227ae63accd627878f2919b1.tar.gz rails-b96464e7eeb90983227ae63accd627878f2919b1.tar.bz2 rails-b96464e7eeb90983227ae63accd627878f2919b1.zip |
Check if etag exists before to do the gsub
This fix the build http://travis-ci.org/#!/rails/rails/builds/2459981
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/http/cache.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/http/cache.rb b/actionpack/lib/action_dispatch/http/cache.rb index d57666525d..0d6015d993 100644 --- a/actionpack/lib/action_dispatch/http/cache.rb +++ b/actionpack/lib/action_dispatch/http/cache.rb @@ -28,8 +28,10 @@ module ActionDispatch end def etag_matches?(etag) - etag = etag.gsub(/^\"|\"$/, "") - if_none_match_etags.include?(etag) + if etag + etag = etag.gsub(/^\"|\"$/, "") + if_none_match_etags.include?(etag) + end end # Check response freshness (Last-Modified and ETag) against request |