Get the nodeinfo address from the well-known
[akkoma] / lib / pleroma / web / pleroma_api / emoji_api_controller.ex
index 391c317e7197c302574c35d5a6dfdd34ebcf8b6d..6beca426ace1438ccb8f1664948eec50cbd35192 100644 (file)
@@ -148,7 +148,13 @@ keeping it in cache for #{div(cache_ms, 1000)}s")
   """
   def download_from(conn, %{"instance_address" => address, "pack_name" => name} = data) do
     shareable_packs_available =
-      "#{address}/nodeinfo/2.1.json"
+      "#{address}/.well-known/nodeinfo"
+      |> Tesla.get!()
+      |> Map.get(:body)
+      |> Jason.decode!()
+      |> List.last()
+      |> Map.get("href")
+      # Get the actual nodeinfo address and fetch it
       |> Tesla.get!()
       |> Map.get(:body)
       |> Jason.decode!()