Add tests, changelog entry
This commit is contained in:
parent
075debe504
commit
c379618b34
|
@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||||
## Changed
|
## Changed
|
||||||
- MastoAPI: Accept BooleanLike input on `/api/v1/accounts/:id/follow` (fixes follows with mastodon.py)
|
- MastoAPI: Accept BooleanLike input on `/api/v1/accounts/:id/follow` (fixes follows with mastodon.py)
|
||||||
- Relays from akkoma are now off by default
|
- Relays from akkoma are now off by default
|
||||||
|
- NormalizeMarkup MRF is now on by default
|
||||||
|
|
||||||
## 2022.11
|
## 2022.11
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.NormalizeMarkupTest do
|
||||||
this is a link with not allowed "rel" attribute: <a href="http://example.com/" rel="tag noallowed">example.com</a>
|
this is a link with not allowed "rel" attribute: <a href="http://example.com/" rel="tag noallowed">example.com</a>
|
||||||
this is an image: <img src="http://example.com/image.jpg"><br />
|
this is an image: <img src="http://example.com/image.jpg"><br />
|
||||||
<script>alert('hacked')</script>
|
<script>alert('hacked')</script>
|
||||||
|
<div class="wow no classes here">mean</div>
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@expected """
|
@expected """
|
||||||
|
@ -25,6 +26,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.NormalizeMarkupTest do
|
||||||
this is a link with not allowed "rel" attribute: <a href="http://example.com/">example.com</a>
|
this is a link with not allowed "rel" attribute: <a href="http://example.com/">example.com</a>
|
||||||
this is an image: <img src="http://example.com/image.jpg"/><br/>
|
this is an image: <img src="http://example.com/image.jpg"/><br/>
|
||||||
alert('hacked')
|
alert('hacked')
|
||||||
|
mean
|
||||||
"""
|
"""
|
||||||
|
|
||||||
test "it filter html tags" do
|
test "it filter html tags" do
|
||||||
|
|
|
@ -77,7 +77,7 @@ test "it works as expected with noop policy" do
|
||||||
clear_config([:mrf, :policies], [Pleroma.Web.ActivityPub.MRF.NoOpPolicy])
|
clear_config([:mrf, :policies], [Pleroma.Web.ActivityPub.MRF.NoOpPolicy])
|
||||||
|
|
||||||
expected = %{
|
expected = %{
|
||||||
mrf_policies: ["NoOpPolicy", "HashtagPolicy", "InlineQuotePolicy"],
|
mrf_policies: ["NoOpPolicy", "HashtagPolicy", "InlineQuotePolicy", "NormalizeMarkup"],
|
||||||
mrf_hashtag: %{
|
mrf_hashtag: %{
|
||||||
federated_timeline_removal: [],
|
federated_timeline_removal: [],
|
||||||
reject: [],
|
reject: [],
|
||||||
|
@ -93,7 +93,7 @@ test "it works as expected with mock policy" do
|
||||||
clear_config([:mrf, :policies], [MRFModuleMock])
|
clear_config([:mrf, :policies], [MRFModuleMock])
|
||||||
|
|
||||||
expected = %{
|
expected = %{
|
||||||
mrf_policies: ["MRFModuleMock", "HashtagPolicy", "InlineQuotePolicy"],
|
mrf_policies: ["MRFModuleMock", "HashtagPolicy", "InlineQuotePolicy", "NormalizeMarkup"],
|
||||||
mrf_module_mock: "some config data",
|
mrf_module_mock: "some config data",
|
||||||
mrf_hashtag: %{
|
mrf_hashtag: %{
|
||||||
federated_timeline_removal: [],
|
federated_timeline_removal: [],
|
||||||
|
|
Loading…
Reference in a new issue