From 4a9a730145d3eb15035049b4f105ab3101180b9a Mon Sep 17 00:00:00 2001 From: Kouhei Sutou Date: Mon, 26 Jan 2015 19:10:05 +0900 Subject: [PATCH] http: do nothing for none content type respose --- lib/grntest/executors/http-executor.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/grntest/executors/http-executor.rb b/lib/grntest/executors/http-executor.rb index f1ceda9..69cf9e1 100644 --- a/lib/grntest/executors/http-executor.rb +++ b/lib/grntest/executors/http-executor.rb @@ -84,25 +84,25 @@ def send_load_command(command) http.read_timeout = @read_timeout http.request(request) end - normalize_response_data(response.body) + normalize_response_data(command, response.body) end def send_normal_command(command) url = "http://#{@host}:#{@port}#{command.to_uri_format}" begin open(url, :read_timeout => @read_timeout) do |response| - normalize_response_data(response.read) + normalize_response_data(command, response.read) end rescue OpenURI::HTTPError $!.io.read end end - def normalize_response_data(raw_response_data) - if raw_response_data.empty? + def normalize_response_data(command, raw_response_data) + if raw_response_data.empty? or command.output_type == :none raw_response_data else - "#{raw_response_data.chomp}\n" + "#{raw_response_data}\n" end end end