From 9167670b2333d0f13a2f8642515cd800a1467a9f Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 23 Mar 2015 03:52:29 +0100 Subject: [PATCH] Disable parsing on non json content. --- lib/user_agent.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/user_agent.rb b/lib/user_agent.rb index 3f8a16412..8762b38dc 100644 --- a/lib/user_agent.rb +++ b/lib/user_agent.rb @@ -304,7 +304,7 @@ returns when Net::HTTPOK data = nil - if options[:json] && response.body + if options[:json] && !options[:jsonParseDisable] && response.body data = JSON.parse( response.body ) end return Result.new( @@ -316,7 +316,7 @@ returns ) when Net::HTTPCreated data = nil - if options[:json] && response.body + if options[:json] && !options[:jsonParseDisable] && response.body data = JSON.parse( response.body ) end return Result.new(