Skip to content

Commit

Permalink
use JSON.parse handle response.body directly
Browse files Browse the repository at this point in the history
  • Loading branch information
leepood authored and Eric-Guo committed Jan 4, 2024
1 parent fe34619 commit d4a992d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/wechat/http_client.rb
Expand Up @@ -111,7 +111,7 @@ def parse_response(response, as_type)
data = file

when :json
data = JSON.parse response.body.to_s.gsub(/[\u0000-\u001f]+/, '')
data = JSON.parse response.body
when :xml
data = Hash.from_xml(response.body.to_s)
else
Expand Down

0 comments on commit d4a992d

Please sign in to comment.