@@ -34,7 +34,8 @@ defmodule AwsExRay.ExAws.HTTPClient do
34
34
35
35
whitelist = WhiteList . find ( service , operation )
36
36
37
- aws_req_params = gather_aws_request_params ( whitelist , body )
37
+ json_codec = ExAws.Config . new ( :xray ) [ :json_codec ]
38
+ aws_req_params = gather_aws_request_params ( whitelist , body , json_codec )
38
39
39
40
headers = HTTPClientUtil . put_tracing_header ( headers , subsegment )
40
41
@@ -49,7 +50,7 @@ defmodule AwsExRay.ExAws.HTTPClient do
49
50
50
51
subsegment = Subsegment . set_http_response ( subsegment , res )
51
52
52
- aws_res_params = gather_aws_response_params ( whitelist , body )
53
+ aws_res_params = gather_aws_response_params ( whitelist , body , json_codec )
53
54
54
55
request_id = Util . get_header ( headers , "x-amzn-RequestId" )
55
56
@@ -99,19 +100,19 @@ defmodule AwsExRay.ExAws.HTTPClient do
99
100
Keyword . put_new ( opts , :recv_timeout , @ default_recv_timeout )
100
101
end
101
102
102
- defp gather_aws_response_params ( _whitelist , "" ) , do: % { }
103
- defp gather_aws_response_params ( whitelist , body ) do
104
- case Poison . decode ( body ) do
103
+ defp gather_aws_response_params ( _whitelist , "" , _json_codec ) , do: % { }
104
+ defp gather_aws_response_params ( whitelist , body , json_codec ) do
105
+ case json_codec . decode ( body ) do
105
106
{ :ok , json } ->
106
107
WhiteList . gather ( :response , json , whitelist )
107
108
108
109
_ -> % { }
109
110
end
110
111
end
111
112
112
- defp gather_aws_request_params ( _whitelist , "" ) , do: % { }
113
- defp gather_aws_request_params ( whitelist , body ) do
114
- case Poison . decode ( body ) do
113
+ defp gather_aws_request_params ( _whitelist , "" , _json_codec ) , do: % { }
114
+ defp gather_aws_request_params ( whitelist , body , json_codec ) do
115
+ case json_codec . decode ( body ) do
115
116
116
117
{ :ok , json } ->
117
118
WhiteList . gather ( :request , json , whitelist )
0 commit comments