From: Haelwenn (lanodan) Monnier Date: Sat, 2 Mar 2019 05:58:42 +0000 (+0100) Subject: RelMe.maybe_put_rel_me/2: When true put "me" otherwise nil X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=8e6f7fdb86bc7f90618c59ee4b13b30b94fda475;p=akkoma RelMe.maybe_put_rel_me/2: When true put "me" otherwise nil --- diff --git a/lib/pleroma/web/rel_me.ex b/lib/pleroma/web/rel_me.ex index 3f0ee9ac6..a07db966f 100644 --- a/lib/pleroma/web/rel_me.ex +++ b/lib/pleroma/web/rel_me.ex @@ -40,12 +40,12 @@ defmodule Pleroma.Web.RelMe do true = Enum.any?(rel_me_hrefs, fn x -> x in profile_urls end) - "rel=\"me\" " + "me" rescue - _ -> "" + _ -> nil end def maybe_put_rel_me(_, _) do - "" + nil end end diff --git a/test/web/rel_me_test.exs b/test/web/rel_me_test.exs index 94cc01728..ba8038e69 100644 --- a/test/web/rel_me_test.exs +++ b/test/web/rel_me_test.exs @@ -37,13 +37,14 @@ defmodule Pleroma.Web.RelMeTest do test "maybe_put_rel_me/2" do profile_urls = ["https://social.example.org/users/lain"] - attr = "rel=\"me\" " + attr = "me" + fallback = nil assert Pleroma.Web.RelMe.maybe_put_rel_me("http://example.com/rel_me/null", profile_urls) == - "" + fallback assert Pleroma.Web.RelMe.maybe_put_rel_me("http://example.com/rel_me/error", profile_urls) == - "" + fallback assert Pleroma.Web.RelMe.maybe_put_rel_me("http://example.com/rel_me/anchor", profile_urls) == attr