Fix Web Push notification delivery

Finch does not automatically append header content-type: octet-stream for binary payloads.
This commit is contained in:
Mark Felder 2023-12-19 10:18:29 -05:00
commit e2066994b1
3 changed files with 51 additions and 1 deletions

View file

@ -6,7 +6,11 @@ defmodule Pleroma.HTTP.WebPush do
@moduledoc false
def post(url, payload, headers, options \\ []) do
list_headers = Map.to_list(headers)
list_headers =
headers
|> Map.to_list()
|> Kernel.++([{"content-type", "octet-stream"}])
Pleroma.HTTP.post(url, payload, list_headers, options)
end
end