Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

data is in post param

  • Loading branch information...
commit 4d2c9fe9286d6ea192402bd43360f1eb5650111d 1 parent 10af2cb
@obfuscurity authored
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"
Please sign in to comment.
Something went wrong with that request. Please try again.