Skip to content

Commit

Permalink
Decode only binary message data
Browse files Browse the repository at this point in the history
  • Loading branch information
mcrumm committed May 2, 2024
1 parent 1677741 commit c1f39a5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/broadway_cloud_pub_sub/pull_client.ex
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,7 @@ defmodule BroadwayCloudPubSub.PullClient do
end
end

defp decode_message(%{"data" => nil} = message), do: message

defp decode_message(%{"data" => encoded_data} = message) do
defp decode_message(%{"data" => encoded_data} = message) when is_binary(encoded_data) do
%{message | "data" => Base.decode64!(encoded_data)}
end

Expand Down

0 comments on commit c1f39a5

Please sign in to comment.