translator now sends Bandwidth's JSON: w/o tstamps
Denver Gingerich
created
We previously sent the JSON blob that included the translator- and
acceptor-generated timestamps. However, it is better is the SGX just
receives precisely the JSON that Bandwidth would have sent it, as that
makes it more easily compatible (i.e. if you want to use the SGX
without the acceptor and translator in front of it). So we do that
here, being careful to pass on valid JSON (otherwise Goliath will have
an HTTP 400 fit).
@@ -91,7 +91,7 @@ while true
uri = URI("http://#{ARGV[1]}:#{ARGV[2]}/")
req = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
- req.body = "{#{new_json_blob}}" # TODO: should just be MSG part (?)
+ req.body = new_json_blob.split('G')[1][2..-1] # only use MSG part
begin
res = Net::HTTP.start(uri.hostname, uri.port) do |http|
http.request(req)