From 53e4a277b38cf218bc8f55f9fa0a7d85aaabb5b9 Mon Sep 17 00:00:00 2001 From: George Claghorn Date: Tue, 16 Jan 2018 15:13:21 -0500 Subject: 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. --- activesupport/lib/active_support/cache/redis_cache_store.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport/lib/active_support/cache') 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) -- cgit v1.2.3