Permalink
Browse files

CGI unescape the POST data

  • Loading branch information...
1 parent 3d58c9a commit ac77b0123076071e6e529dfccf6ecdd83d668e8d @brynary committed Jul 24, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/highcharts_server.rb
View
2 lib/highcharts_server.rb
@@ -11,7 +11,7 @@ def self.root
class Server < Sinatra::Base
post "/charts" do
- chart_options = JSON.parse(request.env["rack.input"].read)
+ chart_options = JSON.parse(CGI.unescape(request.env["rack.input"].read))
hash = Digest::MD5.hexdigest(chart_options.to_json)
image_path = HighchartsServer.root.join("tmp", "charts-#{hash}-#{Time.now.to_i}-#{$$}.png").to_s
cuty_capt = CutyCapt.new(chart_options)

0 comments on commit ac77b01

Please sign in to comment.