diff --git a/lib/web_push/subscription.ex b/lib/web_push/subscription.ex index 844c0d0..722fbb9 100644 --- a/lib/web_push/subscription.ex +++ b/lib/web_push/subscription.ex @@ -31,10 +31,15 @@ defmodule WebPushEx.Subscription do key = String.to_existing_atom(key) value = - if key == :endpoint and is_binary(value) do - URI.parse(value) - else - value + cond do + key == :endpoint and is_binary(value) -> + URI.parse(value) + + key in [:p256dh, :auth, :keys] -> + value + + true -> + value end [{key, value} | acc]