Skip to content

Commit

Permalink
CGI unescape the POST data
Browse files Browse the repository at this point in the history
  • Loading branch information
brynary committed Jul 24, 2011
1 parent 3d58c9a commit ac77b01
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/highcharts_server.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def self.root


class Server < Sinatra::Base class Server < Sinatra::Base
post "/charts" do 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) hash = Digest::MD5.hexdigest(chart_options.to_json)
image_path = HighchartsServer.root.join("tmp", "charts-#{hash}-#{Time.now.to_i}-#{$$}.png").to_s image_path = HighchartsServer.root.join("tmp", "charts-#{hash}-#{Time.now.to_i}-#{$$}.png").to_s
cuty_capt = CutyCapt.new(chart_options) cuty_capt = CutyCapt.new(chart_options)
Expand Down

0 comments on commit ac77b01

Please sign in to comment.