From e2066994b1e64481e0e74350688d91c71d03e230 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Tue, 19 Dec 2023 10:18:29 -0500 Subject: Fix Web Push notification delivery Finch does not automatically append header content-type: octet-stream for binary payloads. --- lib/pleroma/http/web_push.ex | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/pleroma/http/web_push.ex b/lib/pleroma/http/web_push.ex index ca399b6c8..888079c1e 100644 --- a/lib/pleroma/http/web_push.ex +++ b/lib/pleroma/http/web_push.ex @@ -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 -- cgit v1.2.3