Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorMario de la Ossa <mdelaossa@gitlab.com>2019-06-18 23:01:17 +0300
committerMario de la Ossa <mdelaossa@gitlab.com>2019-06-18 23:01:17 +0300
commit82cdee2b7bfc004dba6c7ff45688145ba0a47983 (patch)
treee18b7e31fa5f1622e5b169eb0b95cc69d3a01d28 /spec
parentf41d39f97288d17e0d88a60e61c1b046bd12aa66 (diff)
Fix DOS when rendering issue/MR comments
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/banzai/filter/relative_link_filter_spec.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/lib/banzai/filter/relative_link_filter_spec.rb b/spec/lib/banzai/filter/relative_link_filter_spec.rb
index dad0a5535c0..f49c4e3586c 100644
--- a/spec/lib/banzai/filter/relative_link_filter_spec.rb
+++ b/spec/lib/banzai/filter/relative_link_filter_spec.rb
@@ -83,6 +83,12 @@ describe Banzai::Filter::RelativeLinkFilter do
expect { filter(act) }.not_to raise_error
end
+
+ it 'does not explode with an escaped null byte' do
+ act = link("/%00")
+ expect { filter(act) }.not_to raise_error
+ end
+
it 'does not raise an exception with a space in the path' do
act = link("/uploads/d18213acd3732630991986120e167e3d/Landscape_8.jpg \nBut here's some more unexpected text :smile:)")
expect { filter(act) }.not_to raise_error