adding language tag
authorAlexander Strizhakov <alex.strizhakov@gmail.com>
Mon, 8 Apr 2019 11:03:10 +0000 (11:03 +0000)
committerlambda <lain@soykaf.club>
Mon, 8 Apr 2019 11:03:10 +0000 (11:03 +0000)
lib/pleroma/web/activity_pub/utils.ex
test/web/activity_pub/utils_test.exs

index 32545937ee84a91a49abd1e1a32914c0a1b737d3..0b53f71c3acc25471a9c531a0e9edfdb138e9475 100644 (file)
@@ -99,7 +99,10 @@ defmodule Pleroma.Web.ActivityPub.Utils do
     %{
       "@context" => [
         "https://www.w3.org/ns/activitystreams",
-        "#{Web.base_url()}/schemas/litepub-0.1.jsonld"
+        "#{Web.base_url()}/schemas/litepub-0.1.jsonld",
+        %{
+          "@language" => "und"
+        }
       ]
     }
   end
index 6b9961d82d4a130ca39bd80cfd60c8d2f47aa2d5..758214e680c44560f67db810f7fa72fdaab627d1 100644 (file)
@@ -193,4 +193,16 @@ defmodule Pleroma.Web.ActivityPub.UtilsTest do
       assert Utils.fetch_ordered_collection("http://example.com/outbox", 5) == [0, 1]
     end
   end
+
+  test "make_json_ld_header/0" do
+    assert Utils.make_json_ld_header() == %{
+             "@context" => [
+               "https://www.w3.org/ns/activitystreams",
+               "http://localhost:4001/schemas/litepub-0.1.jsonld",
+               %{
+                 "@language" => "und"
+               }
+             ]
+           }
+  end
 end