Browse files

explicitly use JSON module

  • Loading branch information...
1 parent 71d2b46 commit f6d8454d7f8ce1e4fb0db67184a0bb0eb8c0487e @csquared committed Jul 31, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/rack/worker.rb
View
4 lib/rack/worker.rb
@@ -81,7 +81,7 @@ def call(env)
env = env.select do |key, value|
key.match(/[A-Z_]*/) || key.match(/rack.session/) || value.is_a?(String) || value.is_a?(Numeric) || value.is_a?(Hash)
end
- cache.add("env-#{key}", env.to_json)
+ cache.add("env-#{key}", JSON.dump(env))
marshalled = false
if defined?(Sinatra::Base) && @app.is_a?(Sinatra::Base)
app_str = @app.class.name
@@ -113,7 +113,7 @@ def self.classname_to_class(classname)
end
def self.set_response(key, status, headers, body)
- cache.add("response-#{key}", [status, headers, body].to_json)
+ cache.add("response-#{key}", JSON.dump([status, headers, body]))
end
def get_response(key)

0 comments on commit f6d8454

Please sign in to comment.