diff options
author | Maksim Pechnikov <parallel588@gmail.com> | 2019-06-25 22:25:37 +0300 |
---|---|---|
committer | Maksim Pechnikov <parallel588@gmail.com> | 2019-06-25 22:25:37 +0300 |
commit | 4ad15ad2a90ca1ac370c8a79f796adc603a90479 (patch) | |
tree | 055420375b3fa19c45c8390c1fac1600d7abb08a /test/web/rich_media/helpers_test.exs | |
parent | 0cb8e710fbceb6cc40295f433747e3997d510832 (diff) | |
download | pleroma-4ad15ad2a90ca1ac370c8a79f796adc603a90479.tar.gz pleroma-4ad15ad2a90ca1ac370c8a79f796adc603a90479.zip |
add ignore hosts and TLDs for rich_media
Diffstat (limited to 'test/web/rich_media/helpers_test.exs')
-rw-r--r-- | test/web/rich_media/helpers_test.exs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/web/rich_media/helpers_test.exs b/test/web/rich_media/helpers_test.exs index 1823d9af5..c8f442b05 100644 --- a/test/web/rich_media/helpers_test.exs +++ b/test/web/rich_media/helpers_test.exs @@ -50,13 +50,13 @@ defmodule Pleroma.Web.RichMedia.HelpersTest do {:ok, activity} = CommonAPI.post(user, %{ - "status" => "[test](http://example.com/ogp)", + "status" => "[test](https://example.com/ogp)", "content_type" => "text/markdown" }) Config.put([:rich_media, :enabled], true) - assert %{page_url: "http://example.com/ogp", rich_media: _} = + assert %{page_url: "https://example.com/ogp", rich_media: _} = Pleroma.Web.RichMedia.Helpers.fetch_data_for_activity(activity) end @@ -97,19 +97,21 @@ defmodule Pleroma.Web.RichMedia.HelpersTest do test "refuses to crawl URLs of private network from posts" do user = insert(:user) - Config.put([:rich_media, :enabled], true) {:ok, activity} = CommonAPI.post(user, %{"status" => "http://127.0.0.1:4000/notice/9kCP7VNyPJXFOXDrgO"}) {:ok, activity2} = CommonAPI.post(user, %{"status" => "https://10.111.10.1/notice/9kCP7V"}) - {:ok, activity3} = CommonAPI.post(user, %{"status" => "https://172.16.32.40/notice/9kCP7V"}) {:ok, activity4} = CommonAPI.post(user, %{"status" => "https://192.168.10.40/notice/9kCP7V"}) + {:ok, activity5} = CommonAPI.post(user, %{"status" => "https://pleroma.local/notice/9kCP7V"}) + + Config.put([:rich_media, :enabled], true) assert %{} = Helpers.fetch_data_for_activity(activity) assert %{} = Helpers.fetch_data_for_activity(activity2) assert %{} = Helpers.fetch_data_for_activity(activity3) assert %{} = Helpers.fetch_data_for_activity(activity4) + assert %{} = Helpers.fetch_data_for_activity(activity5) end end |