Skip to content
Browse files

data is in post param

  • Loading branch information...
1 parent 10af2cb commit 4d2c9fe9286d6ea192402bd43360f1eb5650111d @obfuscurity committed Jul 22, 2012
Showing with 1 addition and 4 deletions.
  1. +1 −4 lib/backstop/web.rb
View
5 lib/backstop/web.rb
@@ -57,19 +57,16 @@ def sockets
post '/github' do
begin
- data = JSON.parse(request.body.read)
+ data = JSON.parse(params[:payload])
rescue JSON::ParserError
halt 400, "JSON is required"
end
- p data
halt 400, "missing fields" unless (data['repository'] && data['commits'])
data["source"] = "github"
data["ref"].gsub!(/\//, ".")
- p data
data["commits"].each do |commit|
measure_time = DateTime.parse(commit["timestamp"]).strftime("%s")
s = sockets.sample
- p "#{data['source']}.#{data['ref']}.#{commit['id']} 1 #{measure_time}"
s.puts "#{data['source']}.#{data['ref']}.#{commit['id']} 1 #{measure_time}"
end
"ok"

0 comments on commit 4d2c9fe

Please sign in to comment.
Something went wrong with that request. Please try again.