From fb22ef045f784b9f97954b7b42c17eaea66f3e46 Mon Sep 17 00:00:00 2001 From: "alex.khalevine" Date: Wed, 5 May 2021 09:57:59 +0200 Subject: [PATCH] fix for unhandled body parse error --- .gitignore | 1 + lib/eversign/client.rb | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 2c43bd7..a198dab 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.DS_Store /.bundle/ /.yardoc /Gemfile.lock diff --git a/lib/eversign/client.rb b/lib/eversign/client.rb index 9be3438..45a3c35 100644 --- a/lib/eversign/client.rb +++ b/lib/eversign/client.rb @@ -155,10 +155,12 @@ def send_reminder_for_document(document_hash, signer_id) private def append_sdk_id (body) - unless body.nil? + begin bodyHash = JSON.parse(body) bodyHash['client'] = 'ruby-sdk' return bodyHash.to_json + rescue + return body end end @@ -173,6 +175,7 @@ def execute_request(method, path, body = nil, multipart = false) body = append_sdk_id(body) + @faraday.send(method) do |request| request.url path request.body = body if body