lib/sensu-dashboard/app.rb in sensu-dashboard-0.5.2 vs lib/sensu-dashboard/app.rb in sensu-dashboard-0.5.3
- old
+ new
@@ -198,10 +198,17 @@
end
end
apost '/stash/*.json' do |path|
begin
- http = EventMachine::HttpRequest.new("#{api_server}/stash/#{path}").post :body => request.body.read
+ puts request.body.read
+ request_options = {
+ :body => {'timestamp' => Time.now.to_i}.to_json,
+ :head => {
+ 'content-type' => 'application/json'
+ }
+ }
+ http = EventMachine::HttpRequest.new("#{api_server}/stash/#{path}").post request_options
rescue => e
puts e
status 404
body '{"error":"could not create a stash with the sensu api"}'
end