X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fpleroma%2Fweb%2Fpreload.ex;h=e8588bcc967d078a49b206c82403752ebf7cb52f;hb=e8d88a72cf6633444f9056807f6e048c66cf952d;hp=f13932b890a0fa025954f8ba1341ce8cd935bbf5;hpb=f73b2063f484e83c0972527c00c42d4fbdd11a0c;p=akkoma
diff --git a/lib/pleroma/web/preload.ex b/lib/pleroma/web/preload.ex
index f13932b89..e8588bcc9 100644
--- a/lib/pleroma/web/preload.ex
+++ b/lib/pleroma/web/preload.ex
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors
+# Copyright © 2017-2021 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.Preload do
@@ -9,7 +9,13 @@ defmodule Pleroma.Web.Preload do
def build_tags(_conn, params) do
preload_data =
Enum.reduce(Pleroma.Config.get([__MODULE__, :providers], []), %{}, fn parser, acc ->
- Map.merge(acc, parser.generate_terms(params))
+ terms =
+ params
+ |> parser.generate_terms()
+ |> Enum.map(fn {k, v} -> {k, Base.encode64(Jason.encode!(v))} end)
+ |> Enum.into(%{})
+
+ Map.merge(acc, terms)
end)
rendered_html =
@@ -22,8 +28,6 @@ defmodule Pleroma.Web.Preload do
end
def build_script_tag(content) do
- content = Base.encode64(content)
-
HTML.Tag.content_tag(:script, HTML.raw(content),
id: "initial-results",
type: "application/json"