mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-23 00:26:30 +00:00
Fix nodeinfo handling
This commit is contained in:
parent
ba9d35a904
commit
118d6dcdf4
2 changed files with 4 additions and 3 deletions
|
@ -182,6 +182,7 @@ keeping it in cache for #{div(cache_ms, 1000)}s")
|
|||
|> Tesla.get!()
|
||||
|> Map.get(:body)
|
||||
|> Jason.decode!()
|
||||
|> Map.get("links")
|
||||
|> List.last()
|
||||
|> Map.get("href")
|
||||
# Get the actual nodeinfo address and fetch it
|
||||
|
|
|
@ -41,7 +41,7 @@ defmodule Pleroma.Web.PleromaAPI.EmojiAPIControllerTest do
|
|||
|
||||
mock(fn
|
||||
%{method: :get, url: "https://example.com/.well-known/nodeinfo"} ->
|
||||
json([%{href: "https://example.com/nodeinfo/2.1.json"}])
|
||||
json(%{links: [%{href: "https://example.com/nodeinfo/2.1.json"}]})
|
||||
|
||||
%{method: :get, url: "https://example.com/nodeinfo/2.1.json"} ->
|
||||
json(%{metadata: %{features: ["shareable_emoji_packs"]}})
|
||||
|
@ -77,13 +77,13 @@ defmodule Pleroma.Web.PleromaAPI.EmojiAPIControllerTest do
|
|||
|
||||
mock(fn
|
||||
%{method: :get, url: "https://old-instance/.well-known/nodeinfo"} ->
|
||||
json([%{href: "https://old-instance/nodeinfo/2.1.json"}])
|
||||
json(%{links: [%{href: "https://old-instance/nodeinfo/2.1.json"}]})
|
||||
|
||||
%{method: :get, url: "https://old-instance/nodeinfo/2.1.json"} ->
|
||||
json(%{metadata: %{features: []}})
|
||||
|
||||
%{method: :get, url: "https://example.com/.well-known/nodeinfo"} ->
|
||||
json([%{href: "https://example.com/nodeinfo/2.1.json"}])
|
||||
json(%{links: [%{href: "https://example.com/nodeinfo/2.1.json"}]})
|
||||
|
||||
%{method: :get, url: "https://example.com/nodeinfo/2.1.json"} ->
|
||||
json(%{metadata: %{features: ["shareable_emoji_packs"]}})
|
||||
|
|
Loading…
Reference in a new issue