forked from AkkomaGang/akkoma
Merge pull request 'Bug fix for 2025-01' (#15) from AkkomaGang/akkoma:stable into stable
Reviewed-on: #15
This commit is contained in:
commit
81412a27a6
4 changed files with 10 additions and 2 deletions
|
@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||
|
||||
## Unreleased
|
||||
|
||||
## 2025.01.01
|
||||
|
||||
Hotfix: Federation could break if a null value found its way into `should_federate?\1`
|
||||
|
||||
## 2025.01
|
||||
|
||||
|
|
|
@ -112,7 +112,7 @@ defp allowed_instances do
|
|||
Config.get([:mrf_simple, :accept])
|
||||
end
|
||||
|
||||
def should_federate?(url) do
|
||||
def should_federate?(url) when is_binary(url) do
|
||||
%{host: host} = URI.parse(url)
|
||||
|
||||
with {nil, false} <- {nil, is_nil(host)},
|
||||
|
@ -137,6 +137,8 @@ def should_federate?(url) do
|
|||
end
|
||||
end
|
||||
|
||||
def should_federate?(_), do: false
|
||||
|
||||
@spec recipients(User.t(), Activity.t()) :: list(User.t()) | []
|
||||
defp recipients(actor, activity) do
|
||||
followers =
|
||||
|
|
2
mix.exs
2
mix.exs
|
@ -4,7 +4,7 @@ defmodule Pleroma.Mixfile do
|
|||
def project do
|
||||
[
|
||||
app: :pleroma,
|
||||
version: version("3.14.0"),
|
||||
version: version("3.14.1"),
|
||||
elixir: "~> 1.14",
|
||||
elixirc_paths: elixirc_paths(Mix.env()),
|
||||
compilers: Mix.compilers(),
|
||||
|
|
|
@ -519,6 +519,9 @@ test "publish to url with with different ports" do
|
|||
test "should not obliterate itself if the inbox URL is bad" do
|
||||
url = "/inbox"
|
||||
refute Pleroma.Web.ActivityPub.Publisher.should_federate?(url)
|
||||
|
||||
url = nil
|
||||
refute Pleroma.Web.ActivityPub.Publisher.should_federate?(url)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue