[modulus, exponent] = magickey
|> String.split(".")
- |> Enum.map(&Base.url_decode64!/1)
+ |> Enum.map(fn (n) -> Base.url_decode64!(n, padding: false) end)
|> Enum.map(make_integer)
{:RSAPublicKey, modulus, exponent}
end
defp send_to_user(%{info: %{"salmon" => salmon}}, feed, poster) do
- poster.(salmon, feed, [{"Content-Type", "application/magic-envelope+xml"}], timeout: 10000, recv_timeout: 20000)
+ with {:ok, %{status_code: code}} <- poster.(salmon, feed, [{"Content-Type", "application/magic-envelope+xml"}], timeout: 10000, recv_timeout: 20000) do
+ Logger.debug(fn -> "Pushed to #{salmon}, code #{code}" end)
+ else
+ e -> Logger.debug(fn -> "Pushing salmon to #{salmon} failed, #{inspect(e)}" end)
+ end
end
defp send_to_user(_,_,_), do: nil