Navigation Menu

Skip to content

Commit

Permalink
Use the original JSON to support invalid JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jan 26, 2015
1 parent 7fd688b commit 514c633
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/grntest/executors/http-executor.rb
Expand Up @@ -62,16 +62,16 @@ def command(command_line)
Groonga::Command::Parser.parse(command_line)
end

MAX_URI_SIZE = 4096
def send_load_command(command)
if command.to_uri_format.size <= MAX_URI_SIZE
return send_normal_command(command)
end

values = command.arguments.delete(:values)
request = Net::HTTP::Post.new(command.to_uri_format)
request.content_type = "application/json; charset=UTF-8"
request.body = values
lines = command.original_source.lines
if lines[1].start_with?("[")
request.body = lines[1..-1].join
else
request.body = values
end
response = Net::HTTP.start(@host, @port) do |http|
http.read_timeout = @read_timeout
http.request(request)
Expand Down

0 comments on commit 514c633

Please sign in to comment.