Skip to content

Commit

Permalink
force BINARY encoding when reading from dalli entity store
Browse files Browse the repository at this point in the history
Need to pull together a strategy for handling encodings. The binary
file tests are failing for dalli without this change because
cache.get appears is returning a utf-8 string when that's the
external encoding. That actually seems like correct behavior but
the disk store is setup for binary only so I'm inclined to roll with
it as the default behavior for now.
  • Loading branch information
rtomayko committed Apr 6, 2011
1 parent 7a09ba1 commit 239658f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/rack/cache/entitystore.rb
Expand Up @@ -222,7 +222,9 @@ def exist?(key)
end

def read(key)
cache.get(key)
data = cache.get(key)
data.force_encoding('BINARY') if data.respond_to?(:force_encoding)
data
end

def write(body)
Expand Down

0 comments on commit 239658f

Please sign in to comment.