Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions lib/web_push/subscription.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down