aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Claghorn <george@basecamp.com>2018-01-16 15:13:21 -0500
committerGeorge Claghorn <george@basecamp.com>2018-01-17 01:30:04 -0500
commit53e4a277b38cf218bc8f55f9fa0a7d85aaabb5b9 (patch)
tree5545291711740111be401efee647460fa387e484
parentf21a6688f7d8afd1172ff0bfc1d75e3e619e2db0 (diff)
downloadrails-53e4a277b38cf218bc8f55f9fa0a7d85aaabb5b9.tar.gz
rails-53e4a277b38cf218bc8f55f9fa0a7d85aaabb5b9.tar.bz2
rails-53e4a277b38cf218bc8f55f9fa0a7d85aaabb5b9.zip
Convert keys to binary in the Redis cache store
Fix encoding errors when using the pure-Ruby Redis driver instead of Hiredis. Dodge incompatibilities between UTF-8 and arbitrary value encodings, which rear their heads when the Redis driver tries to build a single command string from incompatibly-encoded keys and values.
-rw-r--r--activesupport/lib/active_support/cache/redis_cache_store.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/cache/redis_cache_store.rb b/activesupport/lib/active_support/cache/redis_cache_store.rb
index e7f015bff5..0368423dad 100644
--- a/activesupport/lib/active_support/cache/redis_cache_store.rb
+++ b/activesupport/lib/active_support/cache/redis_cache_store.rb
@@ -363,7 +363,7 @@ module ActiveSupport
# Truncate keys that exceed 1kB.
def normalize_key(key, options)
- truncate_key super
+ truncate_key super.b
end
def truncate_key(key)