summaryrefslogtreecommitdiff
path: root/spec/support/shared_examples/lib/gitlab/regex_shared_examples.rb
blob: 150741c63444920c9c842b00b27ff12d022876c4 (plain)
1
2
3
4
5
6
7
8
# frozen_string_literal: true

RSpec.shared_examples 'regex rejecting path traversal' do
  it { is_expected.not_to match('a../b') }
  it { is_expected.not_to match('a..%2fb') }
  it { is_expected.not_to match('a%2e%2e%2fb') }
  it { is_expected.not_to match('a%2e%2e/b') }
end