Cast HTTP response body for JSON to string (regression from #4) (#5)

Oj uses `readpartial` instead of `to_s` if the value given for the arguments has a `readpartial` method.
Also, HTTP.rb splits the response if `Transfer-Encoding: chunked` is returned in the HTTP headers.

Will use `to_s` like `JSON.parse` which was used previously.
This commit is contained in:
Yamagishi Kazutoshi 2017-08-04 21:05:28 +09:00 committed by Eugen Rochko
parent 13d8b032fd
commit 29dce59043
1 changed files with 1 additions and 1 deletions

View File

@ -74,7 +74,7 @@ module Goldfinger
end
def parse_json
json = Oj.load(@body, mode: :null)
json = Oj.load(@body.to_s, mode: :null)
@subject = json['subject']
@aliases = json['aliases'] || []